Ubidots Community

Read/write I/O Moxa ioLogik1242 using node-red

Hi,

I’m making a little project, and consist in to read the moisture and temperature. Both variables are analogic (4-20 mA), and i’m using a Moxa ioLogik. The model is 1242, and have DI, DO and AI.

I read the ioLogik with node-red, and then deploy the flow. I could create a dashboard. Until there all is perfect.

Now, i want to write in the iologik. I want to set on/off using the switch widget in one of the DO, but i can’t do it. The Ubidot_In connection it’s ok, but doesn’t write anything.

Thanks

Dear Jose, here’s a recent thread that might help: Ubidots_in - fail return value - the Ubidots_In problem was solved by updating the NodeRED version. Can you check if this is something that might be happening on your side?

Looking forward to hear about your integration with the Moxa ioLogik. It would be the first time (that we know of) integrating this device, so feel free to share further details on how you achieved the integration.

Hi,

Sorry, but today was a long day.
I update the node-red version and… all collapse. In resume, i was to do a new virtual machine; and I had some troubles to solve.

Well, all are running. I installed the last version, and i’m using now node version 12.18.1 and npm 6.14.5; but the error is the same, i connect the signal of the switch.

To test i did a flow with only a “ubidots_in” an a debug.
The flow is:
[{“id”:“379aa47b.fdcf1c”,“type”:“tab”,“label”:“Flow 1”,“disabled”:false,“info”:""},{“id”:“ff771797.c1a038”,“type”:“ubidots_in”,“z”:“379aa47b.fdcf1c”,“tier”:“educational”,“name”:“Ubidots in”,“token”:“BBFF-LRtkKVPzp9Mmft4iwmSqwNf4aCB7we”,“device_label”:“iologik”,“tls_checkbox_in”:true,“custom_topic_checkbox”:false,“label_variable_1”:“encendido”,“label_variable_2”:“humedad”,“label_variable_3”:"",“label_variable_4”:"",“label_variable_5”:"",“label_variable_6”:"",“label_variable_7”:"",“label_variable_8”:"",“label_variable_9”:"",“label_variable_10”:"",“checkbox_variable_1_last_value”:true,“checkbox_variable_2_last_value”:true,“checkbox_variable_3_last_value”:true,“checkbox_variable_4_last_value”:true,“checkbox_variable_5_last_value”:true,“checkbox_variable_6_last_value”:true,“checkbox_variable_7_last_value”:true,“checkbox_variable_8_last_value”:true,“checkbox_variable_9_last_value”:true,“checkbox_variable_10_last_value”:true,“x”:280,“y”:700,“wires”:[[“5579c22d.ee873c”]]},{“id”:“5579c22d.ee873c”,“type”:“debug”,“z”:“379aa47b.fdcf1c”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“false”,“x”:520,“y”:700,“wires”:[]}]

About the integration.
First all, i don’t have a large knowledge in programming, and the protocol MQTT is new for me.
I connect a moisture and temperature sensor to the AI of iologik 1242, both channel are 4-20mA. The scale is 0-80°C for temperature and for the moisture is 0-100ppm; with these parameters i configurated the ioLogik 1242.
Then i did two tests, one connecting directly the iologik to my computer and the other using a cellular modem (a Moxa OnCell 3150). I used a gateway (ioserver) to check the data. All successful.

Then, i did flow in node red. I configurated a “modbus getter” node to read the data. This was ok.

The first time i try to connect the “modbus getter” directly to the “ubidots_out”; but in the side of ubidots i couldn’t see anything. Obviously, the message didn’t have the structure that needs the system.
I resolved this with a function node, with the right configuration, connected to “ubidots_out” and the i could achieve the connection with ubidots.

The next step was to do a Dashboard. This is the link of the dashboard if you want to see:
https://industrial.ubidots.com/app/dashboards/public/dashboard/jERk2r9Zk-QkAwNq82PV2Fjyf5I

In the attached word you can see the complete flow in node-red.

Th following steps are:

  1. Incorporate to the dashboard a switch widget to on/off a digital output of the iologik (yes, my actual problem).
  2. Read digital input. For the moment only i can read 0/1, but in the dashboard, i want to associate a digital input and a alarm. For example, if i read a 0 all it’s ok, but if change to 1 i want to display a message like “overflow alarm”.

Thanks for the support

1 Like

Hello @jrahumadag,

Thank you for sharing your flow so I could inspect what was wrong and why the subscription didn’t work as expected. To this, although you have a STEM account, the type of account is still “Ubidots” within the nodes configuration (for both publish and subscription) and not “Ubidots for Education”, which is intended for Ubidots former education platform, soon to be shut down and completely replaced by the STEM.
Here’s a screenshot of the proper configuration and demonstration (to the right) that the Ubidots_in node works with your account (see last 4 characters of the token)

Now, as an advise, please delete the token you shared in the flow clipboard json and create a new one to prevent people from using it maliciously and avoid damages to your data and account.

Also, please make sure to read the expect output of the Ubidots_in node in its Github repository or within the in-node Docs from node-red.

Best,

–David

HI David,

First all, thanks to the advise. I changed the token.

When i open an account, i did using an education account. Few week ago i update the account to stem, but i didn’t know that i have to do that change. Thanks for this notice.

I did the change, but the problem still persist. I read the info in the repository of Git Hub, but… no news. To publish info i don’t have any problem, but to suscribe is other thing.