Python Script into .JSON file for node red?

In this case with this device, I think you might not need the python script. You could start to try to use the serial node in Node-RED directly. Maybe that will work to get the communication going?

Configure to connect to /dev/ttyUSB0 with the params recommended in the doc

Something like this


Thank you for your answer and sorry for my late response, I was sick for a longer time.

I tried what you told me and i got an Error. (while I got the first report in the debug window the serial nodes said "connected")

( I have also a connection problem, but I'm working on that, I think that the device doesn't get enough power so I ordered a USB hub to test it.)

Can you say if this is an error code about false setting or about the faulty connection I have at the moment?

I thank you in advance!

I think that is a port connection problem. When you connect the device, do you then find the port listed in /dev folder? If so, does it go away when you disconnect?
If I remember from manual correctly you have to start the communication with a specific command. If you send something randomly, it might be the device disconnects the port

What are you sending with the inject node?

PS with correct settings of baudrate, other params etc

I got the usb hub and the connection ist now stable, so the power was the problem.
At first my infect node was "msg.payload = timestamp", but I tried to send different strings like in the SB_MAVO-USB.pdf mentioned, but I still get the same error "error 008".
When I send "msg.payload=msg.payload" with the inject node I got no report at all.



So a good start, I think the error messages are coming from the device, it is not understanding your command

According to documentation you have to start the communication by sending the string *IDN? so this is what you have to put into your inject node

Then also as stated in the document you have to add line feed after the command. Check your setting for ”Versand”, ”Zeichen zu Ausgangsnachrichten hinzufugen”, add \n here
Now try again, if it works you should see a response coming in like IDN GOSSEN …..

Best regards, Walter

Thank you!
So I tried what you said and I still get the same report. Did I do anything wrong ?
( I also tried *IDN, *idn, idn?, IDN?, idn and IDN, but same report


Maybe not enough but….you have /n when it should be \n

Second possible problem could be your user has no access rights to the port

But first try to correct the thing mentioned

and sometime devices prefer \r rather than \n so try that also.

oh, my fault.
But it Works!!

1 Like

thank you ! I keep that in mind when I connect other devices :slight_smile:

Good news! Now you can continue to read light values from your device!

Thank you very much !
It works completely fine, here is an example. The value matches with the one on the display of the device. :slight_smile:

WICHTIG

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.