Trying to read my first sensor (HC-SR04) #105
Replies: 14 comments 35 replies
-
I had also tried to merge both files, but after that the flow also does not send any messages:
|
Beta Was this translation helpful? Give feedback.
-
I have successfully used used the DS18B20 node and the Analogue input nodes from the mcu set. You should not have to do any messing with manifest files I don't think. At least I didn't. This is running on a laptop with a Wemos D1 Mini connected via USB. Are you using the plugin direct from github? There have been some improvements recently and I don't know whether the plugin has been released to npm. I have been running from github and re-installing the node occasionally to make sure I get the latest plugin and the latest node-red-mcu. If still no joy then it might be an idea to get it going direct using node-red-mcu initially. Then you will know whether the problem is with the plugin or with node-red-mcu or hardware etc. |
Beta Was this translation helpful? Give feedback.
-
Hi @colinl, Yes I had installed the plugin from github (version 1.2.1-post), so node-red-mcu is installed automatically as a dependency. I had first tried it without messing with the manifest file, but since that didn't work I tried to change it a couple of times. But I got no response at all from the board. Had hoped to see some informational messages arriving in my xsbug-log, to tell me that I had configured it incorrectly. But nothing appears there either, so I don't have a clue what I am doing wrong... |
Beta Was this translation helpful? Give feedback.
-
Let's take a moment to celebrate that. ;)
The pin numbers are GPIO values. Your use of 15 and 14 looks reasonable. (I recall that for the original Raspberry Pi, Node-RED GPIO does not use GPIO numbers, but... that doesn't scale. The pin numbers on the board are random across different vendors. GPIO numbers are stable and don't require any remapping.)
Your merged manifest looks reasonable. You might want to confirm that its s being used, just in case that's the wrong file to edit. Quick hacks for that are simply to use an invalid path or to make the JSON invalid, either of which will should fail to build. I would start by making sure that the flow is running and the sensor is working. So...
FWIW – when you do get back to the MQTT Out node, the "birth message" is supported on the broker. That's a convenient way to verify that the flow is running and connects to the broker. (I don't currently have access to my HC-SR04 sensor, so I cannot try it myself right now.) |
Beta Was this translation helpful? Give feedback.
-
Hi @phoddie, I have modified my flow to this one:
On both debug nodes, I have selected all 3 output options (to get as much info as available): This is what I see:
Again any tips are welcome!! |
Beta Was this translation helpful? Give feedback.
-
That's what I get when running your flow (on a different MCU):
The error message was expected. Thus I guess your flow is not running. |
Beta Was this translation helpful? Give feedback.
-
@ralphwetzel But if I keep receiving mqtt messages, then my flow is running I assume. But based on your feedback I think you must be right. Perhaps some uncleaned leftover from one of my many experiments is giving me confusing information...
Are there any other things I can check? Because the flashing is succesfull |
Beta Was this translation helpful? Give feedback.
-
It might be worth using something like MQTTExplorer to montor MQTT (if you are not already) then first stop node-red to make sure that the mqtt is not originating there, then power off the mcu to make sure it then stops. Then power it on again and it should restart. Then you will at least be certain that it is something running in the mcu that is generating the MQTT. I got very confused for a while because I had a rogue flow in node red publishing to the same topic. |
Beta Was this translation helpful? Give feedback.
-
I have added a function node to my flow, which simply adds the prefix "timestamp from my mcu = " to the payload of my messages: And immediately after deploying, that change becomes visible in my MQTT Explorer: Which means my flow is being flashed correctly, and it is running. But still no information from my Debug nodes or the Sensor node. Neither in the Debug sidebar or in the xterm terminal on Ralph's MCU sidebar. BTW all the nodes from my flow are included in the /home/pi/.node-red/mcu-plugin-cache/t5rg16s07b/flows.json file. So my entire flow is correctly in that file. |
Beta Was this translation helpful? Give feedback.
-
@ralphwetzel,
Finally I have become aware of what is going on my MCU. That is wonderful news!! Summarize at this stage I now have two issues left:
. Perhaps it is easier to start with the new mechanism for the manifest files? I have to admit that the whole manifest setup is not quite clear to me... So it is very nice to see that some progress is being made to automate this part. |
Beta Was this translation helpful? Give feedback.
-
So it seems I need to focus now on this error:
@colinl : based on your experiments, do you think it is better/easier for me to continue with the new proposal for manifests? Because the manifest stuff is a bit mind-blowing for me in the evenings, after a heavy day at the daily job... |
Beta Was this translation helpful? Give feedback.
-
@phoddie, Your proposal is VERY generous! But indeed it might be better to do it like that, so that we can discuss this face to face. I see that we have a time difference of 9 hour, so hopefully you can find a time interval on Thursday early afternoon that is feasable for the both of us. I will upgrade tomorrow my SDK and node-red-mcu-plugin to the latest version, and make sure my wt32-eth01 setup is next to my pc. Is there anything else I should prepare to make sure we have a smooth discussion? I will also try to remove my Sensor node and add it again, to make sure it contains the new moddable_manifest property. |
Beta Was this translation helpful? Give feedback.
-
I can be available between 11 AM and 3 PM Thursday, which appears to be 8 PM to midnight for you. What time works for you?
That all seems great. In the meantime, I'll try to run a simple test with the bizarre WT32-ETH01 and HC-SR04 to refresh my memory about all those details. |
Beta Was this translation helpful? Give feedback.
-
Morning @ralphwetzel, @phoddie, I had very weird sensor values after our session. So I have reviewed my wiring and there was an inconsistency in my ground between the HC-SR04 and the WT32-ETH01. After fixing that, I now see correct accurate readings: Thanks a lot guys! You are my heroes for today ;-) Will write a tutorial now as soon as possible, so hopefully some other users start experimenting with Moddable from Node-RED. Have a nice sunday!! Bart |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everybody,
I have my first simple flow running on my WT32-ETH01 board: an inject node sends every 5 seconds a message via an mqtt-out node to Node-RED. That works fine, so I would now like to measure distance using an HC-SR04 ultrasonic sensor:
So I have added a Sensor node to my flow:
These are the settings of the Sensor node:
My flow doesn't do anything, i.e. no messages arrive anymore in my MQTT broker. So I must be doing something wrong. Some questions:
Thanks!!
Bart
Beta Was this translation helpful? Give feedback.
All reactions