-
-
-
Adafruit has the display as well:
https://www.adafruit.com/product/4098
Dear allObjects, did you find the time to use this display with espruino ?
Thanks
Sacha -
-
Hello Gordon
Quick question before i start a little project. Is UDP supported on a pico with WIZnet as it is on EspruinoWIFI ?
https://www.espruino.com/WIZnet
Many thanks for your answer.
Sacha
-
-
Hi Gordon
Thanks for your help. How much mem will eval use ? I think i allocate some spare space ?
var evalneed='How much is needed for eval ?'; if (x===undefined) { throw new Error("Not enough RAM for .bootcde"); } else { evalneed=''; // Required for eval // Ugly hack ! eval('var x = E.toString(ST.read(".bootcde")); ST.eraseAll(); ST.write(".bootcde",x); console.log("survived");'); // Here i do a reset via my custom watchdog function. }
-
Hi Gordon
After switching to "save to flash" in the IDE, i got a lot of more RAM free. After deleting all files except ".bootcde" and calling compact, nothing new. I do not get flashmemory back.
Then i made a very ugly hack that seems to work!
// ST is the storage object var x = E.toString(ST.read(".bootcde")); if (x===undefined) { throw new Error("Not enough RAM for .bootcde"); } else { // Ugly hack ! eval('var x = E.toString(ST.read(".bootcde")); ST.eraseAll(); ST.write(".bootcde",x); console.log("survived");'); // Here i do a reset via my custom watchdog function. }
After the reboot everything is working fine, storage is freed and ready for reuse ;-)
Sacha
-
-
Hi Gordon
Thanks for your answer. I got "not enough RAM for varimg".
Save() is not an option. After the reboot, i get errors in the console. Wifi communication fails.With the save to flash option in IDE i'm not familiar. Do you have a link where i can read about this ?
EDIT: Found: https://www.espruino.com/Saving
Thanks
Sacha -
Hi Gordon
I have several EspruinoWIFI distributed in my house.
The Espruinos are "installed", in most cases difficult to connect via USB again.They all communicate to each other over IP. They know each other over UDP dynamicaly.
Each espruino has a little "core" software saved.
The over all configuration of all espruinos and additional code for different devices (Replays, Sensores, etc.)
are dirtibuted over wifi to the espruinos as needed by the "core" software.Every espruino will get the config and the individual needed additional device code to use and store it on the storage.
So i have a full redundancy. Each espruino has stored the config of all espruinos and several espruinos has stored small code for
different devices like sensores etc.They inform each other about the newest config version and the version of the small code pieces over udp.
If a espruino has a newer version of the config for all espruinos or a newer version of code for connected
devices (Relay, Sensor etc.), the other espruinos will request and get them over tcp too.That is the reason why i use a lot of the storage and get in trouble with it.
That's why i'm looking for a way to wipe out everything except the saved code from the storage.
In that case the config and the needed additional code can be downloaded and stored again.Greetings
Sacha
-
Hi Gordon
Thanks for your fast answer. I tried the latest 'cutting edge' build. Same result.
After deleting everything exept the .varimg and calling compact(); again, i do not get any space back.It would be very nice if you could implement a way to delete the flash for reuse without deleting the saved code. Like eraseAll() but without deleting the saved code.
Thanks
Sacha -
Hello Gordon
I tried the storage function on FW 2.00I transfered some files over wifi and stored them using the storage.write();
After deleting all files exept the saved code, i do call storage.compact().But i do net get the space back ?
>ST.getFree(); =22516 // Transferred some files and stored: >ST.list(); =[ ".varimg", "init", "config", "CORE", "DOUT", "SW", "reboot" ] // New Free. >ST.getFree(); =9504 >ST.erase('init'); =undefined >ST.erase('config'); =undefined >ST.erase('CORE'); =undefined >ST.erase('DOUT'); =undefined >ST.erase('SW'); =undefined >ST.erase('reboot'); =undefined >ST.list(); =[ ".varimg" ] > ST.compact(); =undefined // Free ? >ST.getFree(); =9504
Thanks for the help.
Sacha
P.S.: A storage.eraseAll() function that removes everything exept the saved code would be nice (As an option for eraseAll() ) ?
-
-
-
-
Hello Gorden
Tested it about 30 minutes. Crashing is fixed i think. A lot of garbage, that i will filter out.
Here is the output:UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","nam UDP Msg: 101.34.58.34:19807 - "cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name": UDP Msg: 34.95.77.34:8748 - g":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M" UDP Msg: 44.34.99.102:8807 - 87} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","nam UDP Msg: 101.34.58.34:19807 - "cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type": UDP Msg: 34.83.89.83:11298 - ame":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type" UDP Msg: 58.34.83.89:8787 - name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","n UDP Msg: 97.109.101.34:8762 - ","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type": UDP Msg: 34.83.89.83:11298 - ame":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":" UDP Msg: 95.77.34.44:25378 - ":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":"SYS","name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type" UDP Msg: 58.34.83.89:8787 - name":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"type":" UDP Msg: 83.89.83.34:8748 - me":"_M","cfg":187} UDP Msg: 192.168.68.13:59683 - {"ty UDP Msg: 112.101.34.58:21282 - ","name":"_M","cfg":187}
Thanks Gorden for fixing the crash that fast.
Sacha
-
-
Last message for today Gordon.
I managed to capture a crash using the isolated code above with debug enabled.
I changed the UDP server code to send a UDP package each 100ms and not every 10 seconds.] "\r\n+IPD,0,36,1" ] "92.168.68.13,51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192." ] "168.68.13,51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IP" ] "D,0,36,192.168.68.13,51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13" ] ",51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n" ] "+IPD,0,36,192.168.68.13,51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+" ] "IPD,0,36,192.168.68.13,51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68." ] "13,51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36" ] ",192.168.68.13,51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13," ] "51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.1" ] "68.68.13,51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD" ] ",0,36,192.168.68.13,51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r" ] "\n+IPD,0,36,192.168.68.13,51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168" ] ".68.13,51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,3" ] "6,192.168.68.13,51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,51158:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg" UDP Msg: 192.168.68.13:51158 - {"type":"SYS","name":"_M","cfg ERR: UPD packet not JSON, ignore --- crash ----
The last message was truncated to. Not two chars.
I think you should be abe to reproduce it with my isolated code. Just change the linux server to 100ms and enable debug on the espruino side.
-
Next test in isolated code. Turbomode enabled debug not enabled. It crashed too.
UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M" ERR: UPD packet not JSON, ignore UDP Msg: 44.34.99.102:8807 - 87} ERR: UPD packet not JSON, ignore UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"t ERR: UPD packet not JSON, ignore UDP Msg: 121.112.101.34:8762 - S","name":"_M","cfg":187} ERR: UPD packet not JSON, ignore UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg": ERR: UPD packet not JSON, ignore -- crash --
-
I enabled turbomode in the isolated code and the mixed up data is shown up. I was able to catch debug code. Did not crash.
____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 1v96 (c) 2017 G.Williams > =undefined >save(); =undefined Compacting Flash... Calculating Size... Writing.. Compressed 114368 bytes to 26882 pong Connected: 192.168.68.158 ["AT+CIPSTART=0,\"UDP\",\"255.255.255.255\",7077,7077,2\r\n" ] "0,CONNECT\r\n\r\nOK\r\n" ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"typ" UDP Msg: 192.168.68.13:45962 - {"typ ERR: UPD packet not JSON, ignore UDP Msg: 101.34.58.34:22867 - ,"name":"_M","cfg":187} ERR: UPD packet not JSON, ignore ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IP" ] "D,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\nIPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\"" UDP Msg: 192.168.68.13:45962 - {"type":"SYS" ERR: UPD packet not JSON, ignore UDP Msg: 44.34.110.97:25965 - "_M","cfg":187} ERR: UPD packet not JSON, ignore ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187 ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} OK:187
-
It's a bit frustrating. I waited so long for that feature ;-).
My fealing is that there are two problems.
First that something is mixed up resulting in wrong data. Wrong IP and trancated messages.
I'm able to filter that out. I think this has not a crash in result.The second problem, truncating the last chars is resulting in a crash. Like on the last line above.
It's the same that we get in the isolated code above without debug enabled.Sacha
-
Thanks Gordon
Without the debug enabled, i get the error and crash within a few minutes.
When debug enabled i was also not able to reproduce it with 20 minutes !?I enabled debug to my projectcode. It shows the wrong ip's, fragments of the udp messages and crashes very fast. I think it makes no sense to post the projectcode. It to big.
Here is the output. I only add a console.log of the UDP ip, port and message received. Starting with "UPD Msg: "
The correct source ip is 192.168.68.13
] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\"" UDP Msg: 192.168.68.13:45962 - {"type":"SYS" UDP Msg: 44.34.110.97:25965 - "_M","cfg":187} ] "\r\n+IPD,0,36,192.16" ] "8.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\"" UDP Msg: 192.168.68.13:45962 - {"type" UDP Msg: 58.34.83.89:8787 - name":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"n" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","n UDP Msg: 97.109.101.34:8762 - ","cfg":187} ] "\r\n+IPD,0,36" ] ",192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} ] "\r\n+IPD,0,36,192" ] ".168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} ] "\r\n+IPD,0,36,19" ] "2.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":" UDP Msg: 95.77.34.44:25378 - ":187} ] "\r\n+IPD,0,36,1" ] "92.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"t" UDP Msg: 192.168.68.13:45962 - {"t UDP Msg: 121.112.101.34:8762 - S","name":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name": UDP Msg: 34.95.77.34:8748 - g":187} ] "\r\n+IPD,0,36" ] ",192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"nam" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","nam UDP Msg: 101.34.58.34:19807 - "cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"t" UDP Msg: 192.168.68.13:45962 - {"t UDP Msg: 121.112.101.34:8762 - S","name":"_M","cfg":187} ] "\r\n+IPD" ] ",0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187}" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"" UDP Msg: 192.168.68.13:45962 - {"type":" UDP Msg: 83.89.83.34:8748 - me":"_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\"" UDP Msg: 192.168.68.13:45962 - {"type":"SYS" UDP Msg: 44.34.110.97:25965 - "_M","cfg":187} ] "\r\n+IPD,0,36,192.168.68.13,45962:{\"type\":\"SYS\",\"name\":\"_M\",\"cfg\":187" UDP Msg: 192.168.68.13:45962 - {"type":"SYS","name":"_M","cfg":187 > // crashed
-
"listening" is not implemented. Espruino code reduced to:
/* ESPRUINO WIFI */ var WIFI_NAME = "Paradise"; var WIFI_OPTIONS = { password : "XYZ" }; var PORT = 7077; var wifi = require("EspruinoWiFi"); var dgram = require('dgram'); wifi.connect(WIFI_NAME, WIFI_OPTIONS, function (err) { if (err) { console.log("Connection error: " + err); } wifi.getIP(function (f, ip) { console.log("Connected: " + ip.ip); // UDP Broadcast var client = dgram.createSocket("udp4"); client.on('message', function (message, rinfo) { console.log('UDP Msg: ' + rinfo.address + ':' + rinfo.port +' - ' + message); try { var u = JSON.parse(message); console.log('OK:'+u.cfg); } catch(err) { console.log('ERR: UPD packet not JSON, ignore'); } }); client.bind(PORT); }); });
This way