I have managed to build my template, datastreams and IOS app. I was worried about disrupting my current setup so I installed node-red on an old laptop and built a few test nodes. I got them working to my satisfaction so I tried migrating the flows on my RPi.
I tried a very simple case of turning on an LED for 5 seconds. Here are the messages I get:
19 Jul 14:27:30 - [info] Starting flows
19 Jul 14:27:30 - [info] [blynk-iot-client:Blynk IOT] LOG PINS
19 Jul 14:27:30 - [info] [blynk-iot-client:Blynk IOT] ## FUNC startconn
19 Jul 14:27:30 - [info] [blynk-iot-client:Blynk IOT] ## SET logged FALSE
19 Jul 14:27:30 - [info] [blynk-iot-client:Blynk IOT] Start TLS connection: blynk.cloud:443
19 Jul 14:27:31 - [info] Started flows
19 Jul 14:27:31 - [info] [udp in:d45abbba.f87148] udp listener at 0.0.0.0:1024
19 Jul 14:27:31 - [info] [mqtt-broker:RPI] Connected to broker: mqtt://localhost:1883
19 Jul 14:27:31 - [info] [blynk-iot-client:Blynk IOT] ## TLS state: open
19 Jul 14:27:31 - [red] Uncaught Exception:
19 Jul 14:27:31 - TypeError: Invalid data, chunk must be a string or buffer, not object
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Unit entered failed state.
nodered.service: Failed with result āexit-codeā.
nodered.service: Service hold-off time over, scheduling restart.
Stopped Node-RED graphical event wiring tool.
Do you mean that youāre un-installing the contrib, either via the command line or the palette manager, or simply removing the nodes from Node-Red flows?
I donāt understand that comment at all. Can you elaborate?
it would be helpful to understand if the error occurs when the contrib is installed, but none of the nodes from the contrib are used in the flows.
This line of your message looks a bit odd to meā¦
In Node-Red, press CTRL F to open a search dialogue and paste the node ID of d45abbba.f87148 into the search criteria. What node does it show, and is this anything to do with the Blynk IoT contrib?
For info, this is what my console shows on start-up
Sorry, I struggled with how to communicate the ābackupā partā¦ I copied the file flows_raspberrypi.json to my PC. When node-red on the pi crashes, I copy the file back to the pi before restarting node-red. That way, I know my original flows are still intact.
This action also removes the IOT nodes from the my test flow. The contrib lib is still in the palette, but as no nodes are in the flows, there is no attempt to connect the blynk server.
I was attempting to log some activity. The log file associated with this node was last updated in 2019 so this node is not doing anything useful and I will remove it.
Your console output looks similar to what I see on my laptop test machine. With the login info showing. Iām not getting that far on the pi.
Per your suggestion, I Googled my error message. It appears to be associated with node.js. Further investigation suggests my version of node.js is very out-of-date and may not support TLS. I did start working on all this back in 2018.
Iām in the process of backing up my piās SD card. Iāll then update my node.js and try the new IOT nodes again.
In the process of updating node.js. I really donāt want to update my OS if I donāt have to. I have a pretty extensive project running on the RPI and would hate to have to rebuild that.
Thanks for your help. Its nice to have someone point out the things youāve missed.
Updated to Node-RED version: v2.0.1 (I know, you suggested to stay 1.xx, it came along with the node.js) and Node.js version: v12.22.2.
My simple test flow is working. Iāll move on to moving the other nodes over. Iāll update as to whether everything works or if I have more problems.
I am happy to report Iāve completed my conversion and everything appears to be working as expected. I have implemented the LCD node and it is functioning for me.
To summarize my issue, the problem appears to have been an outdated version of Node.js.
Good to hear Larry.
Itās always nice to hear of another convert to the dark side
One of the things Iām doing with my migration to Blynk 2.0 with the new version of the Blynk contrib is to use a single device.
Previously, Iād started by going down the route if one Blynk device per physical device. However, this quickly became quite messy, so I switched to one device per room, but that wasnāt ideal.
Because of the way that the Blynk 2.0 app forces the use of tiles, and I only want to use one tile for my UK home and one for my holiday home, Iāve used one device per home.
This allows me to use the 256 virtual pins to display data in the one tile, ln multiple tabs.
This isnāt done to save devices (I have free access to the PRO plan, so thatās not an issue) but simply want everything in one place to allow me to to use a single tile.
Just did some more testing, and it seems I was injecting data in the wrong format when I did my testing. Iāve updated the issues log to reflect the fact that it works as expected.
I agree with you about the device/tiles. My project is very simple. It would be nice to go straight to my screen with the tabs instead of the tile first. The price of progress ;-).
Good to hear the LCD is working for you now. Again, my project is very simple and the conversion, while time consuming, was pretty straight forward. In most cases, I simply replaced the write event and write nodes from the old ws lib with their counterparts in the iot lib. It took me days to get to the Node.js solution. I went down too many wrong rabbit holes.
So, Iāve found something that acts differently between the old websockets lib and the IOT lib. Iām using the terminal on my IOS device app. Neither lib had a terminal node but I found if I send strings to the terminal virtual pin, the terminal acted as expected in the old lib but not in the new lib.
The IOS device must be unlocked and open to the Blynk app for the terminal to display anything sent to it with the new lib.
Do you have any experience with the terminal widget?
Agreed. Move to a new topic? Should we ask Gab to look into adding a terminal node? I am, after all, essentially using virtualwrite rather than terminal.write. But that seemed to work just fine under blynk 0.1.
Iām not running Blynk code anywhere, only using node-red.