How to get Blynk running on OpenWrt?

do you think it could run on a lynksys wrt54gs?
I’m not sure, but I think it could run on a dlink NAS DNS320

@Blynk_Coeur if you can install lua (which should be there already if you have LuCI), luasocket and luasec packages - it should work

thank you Volodymyr ,

and what about DNS320 NAS witch has java 8 installed ?

Here is an example on how to run a Blynk client with Lua: https://github.com/vshymanskyy/blynk-library-lua
It was tested on OpenWrt and Ubuntu Linux.

1 Like

@Blynk_Coeur I’m talking about Blynk client.
The server should work with all the hardware, that is capable of running the latest Java Runtime.

Running a client was a pain for OpenWrt, as it required:

  • Node.js, Python (which aren’t welcome on most routers)
  • or C++ (required advanced skills and recompiling your code every time).

Now with the Lua library, you can easily install it and develop your scripts.
Hope that helps!

1 Like

oh sorry !
so I will try to implement blynk server on my D-LINK NAS .

@raphik does this fit your needs?

1 Like

Thanks a lot! I have been in other things these days. I’m testing it now. Soon I will report the results.

Being tested on Router Huawei EchoLife HG553
OpenWRT version: LEDE Reboot 17.01.6
Lua version: Lua 5.1.5, luasec 0.6-1, luasocket 3.0-rc1-20130909-3.

Reading button:

-- callback to run when V1 changes
-- turns the power led on and off
blynk:on("V1", function(param)
  os.execute("echo "..param[1].." > /sys/class/leds/HW553:red:power/brightness")
end)

Displaying data:

-- callback to run when cloud requests V0 value
-- retrieve the ammount of seconds the script is running
local time0 = os.time()
blynk:on("readV0", function(param)
  blynk:virtualWrite(0, os.time()-time0)
end)

100% stable performance.

1 Like

I’m doing some tests of my own. Do you want me to do some specific test?

WRT54GS may work or not. It depends on its version. The problem is the lack of flash memory.
https://wiki.openwrt.org/toh/views/toh_extended_all?dataflt[Model*~]=WRT54GS

you are right, not enough memory on my wrt54gs.
I can only run dd-wrt
:wink:

@Blynk_Coeur I think Lua is also available for dd-wrt

not enough memory.
but I’ll try soon.
but if one day you can install blynk server on Dlink DNS 320, I’m very interested.

Blynk.lua Client also tested on Router Comtrend AR-5387un
OpenWrt 18.06.1
Lua version: lua 5.1.5-1, luasec 0.6-1, luasocket 3.0-rc1-20130909-4

It works like a charm!

1 Like

@raphik please post more info about your project as you have something. Thanks!

I tryed to run Blynk for Lua v0.1.3 and got

lua: ./blynk.lua:91: attempt to call field '_send' (a nil value)
stack traceback:
        ./blynk.lua:91: in function 'sendMsg'
        ./blynk.lua:99: in function 'connect'
        ./blink.lua:39: in function 'connectBlynk'
        ./blink.lua:94: in main chunk
        [C]: ?

Any clue?

@raphik , the example has changed as well. Please note that you need to require a different file from the library. I do not plan to make any further breaking changes in near future.

I know. Actually I changed library, timer and example from the same zip file (https://github.com/vshymanskyy/blynk-library-lua/archive/master.zip)

I’m downloading/testing it again.

@raphik
I rechecked, it should work fine.
Be sure to have:

local Blynk = require("blynk.socket")

Or just use the latest example. Let me know if the problem persists