Mango with Raspberry pi and PLC
-
In the /classes/env.properties file there is a section for the serial port detection that looks like this:
#Regex used to match serial ports so they show up in the menu serial.port.linux.regex=((cu|ttyS|ttyUSB|ttyACM|ttyAMA|rfcomm|ttyO|COM)[0-9]{1,3}|rs(232|485)-[0-9]) serial.port.linux.path=/dev/
You might need to adjust the regex that is used.
-
Hi Chanaka,
I suspect ttyUSB0 is your serial port?
I do not understand what you are asking about.
-
@phildunlap I can't detect Nodes when i run mango in raspberry pi. i think it is occurred due to problem of usb serial communication. because when i use that cable for my laptop i had to install usb drivers manually.
-
You have supplied very little useful information. You have not said your data source, the data source tool you are trying, or the error you are getting. You should check your logs and events for useful messages, as well as the output from the tool that is not working.
We cannot help you with a driver problem for your serial converter (if that is the problem), but I suspect anyone who can help here or elsewhere would benefit by knowing things like the make and model number. But, most advice will say use a serial port capture or known test to see if your wires are working. There are lots of ways to do that, including using the Serial Data Source (catch incoming if you're worried about that, or two Serial data sources communicating between two ports).
-
@phildunlap @JoelHaggar there is no any nodes found even it is goes to 100%
-
Not all devices will respond to the node scan so you are better off testing the exact slave ID and a register you know on your device. If that fails then you need to check things like your baud rate. You should also use a serial adapter with RXTX lights so you can verify something is being transmitted.
-
I agree with Joel; I've not had good luck with the scanning feature. Read an exact point you want and then you can be more sure.
-
Check if You have permition to access serial device. In terminal write:
id YOURUSERNAME
you should see something like this:
uid=1001(YOURUSERNAME) gid=1001(YOURUSERNAME) groups=1001(YOURUSERNAME),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),109(netdev),110(lxd)
You should be member of the dialout group. If not, write in terminal:
sudo usermod -a -G dialout YOURUSERNAME
it should help.
-
Thanks for the tip przemom!
-
@JoelHaggar @phildunlap @mihairosu @przemom thanks for you all.. I could establish communication between raspberry pi and PLC using raspberry pi GPIO pins and MAX232 board after lot of efforts. now mango can detect node. i had to change baud rate , parity of PLC as compatible with Raspberry pi.
now everything seems fine. but still i don't know about system reliability.
Thank you -
@chanaka Hi, Could you please tell me how to do communication between PLC and Raspberry pi with RS485???
-
Hi,
If You ask about RS485 I assume that You want to communicate via Modbus RTU. In this case, with raspberry pi I prefer solution:- Use usb/rs485 converter (like this https://www.amazon.com/JBtek-Converter-Adapter-ch340T-Supported/dp/B00NKAJGZM - it has drivers included into the kernel) or better - some industrial usb isolated usb/rs485 converter)
- To communicate with the PLC you have to know it's Modbus ID and registers addresses.
What brand of PLC You want to communicate with?
I use RPIs to communicate via rs485 with Power Meters and it works without problems.
Best regards,