Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

Mango with Raspberry pi and PLC


  • I'm doing project using mango, raspberry pi and PLC .My mango software is running on raspberry pi 3 model B computer. PLC is connected to raspberry using USB serial cable. I access raspberry pi using Putty software which is running on my laptop.(Rsapberry pi is connected to my laptop through router). when i run mango on raspberry pi it is working properly. but when I scan node using Mango interface (I accessed mango interface by using ip and port ) there is no any node detected. (but when i run mango on my laptop it is working properly and Mango can detect nodes).
    there is three ports are automatically detected by mango when it run on raspberry pi. they are /dev/ttyUSB0 , /dev/ttyAMA0 and /dev/ttyS0.

    can anyone help me ?

    Thank you


  • 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 0_1477486283436_m1.PNG 0_1477486290161_m2.PNG 0_1477486299822_m3.PNG 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.


  • @Chanaka

    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:

    1. 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)
    2. 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,