Modbus Read Data Error Message: serial port exception
-
I had a few power meters connected in a daisy chain. To ensure the comm and wiring is healthy, I used a third party software modscan32 to read a energy data value. Everthing is perfect. Detail of connection is
SlaveId=2![2_1456843084357_error1.jpg](Uploading 100%) ![1_1456843084356_modscan1.jpg](Uploading 100%) ![0_1456843084355_modscan2.jpg](Uploading 100%)
Modbus PointType=Holding Register
Register Address=43060, 4 byte
DataType=Swapped FP
The return value of 59.9889 was correct.
(refer to photo 1&2 for result of communication test)Next I transfer the same daisy chain to USB-RS485 convertor and connected to a serial port of MangoES.
I created a datasource and a datapoint. After enable both the created datasource and datapoint, I tried a modbus read data for same energy data value.
However encounter error message"There is a problem testing the locator
(com.infiniteautomation.mango.io.serialPort.Exception:port/dev/ttyusb0 in use by mango modbus data source Ds_336910)"I tried out all three port dev/ttyACM99, dev/ttyUSB0, dev/ttyUSB1 but no success.
Has anyone encounter these message before?
What need to configure for the modbus serial properties in order to read the energy data value from the power meter in the MangoES ?
Are there any special requirement for the connection via USB port?
What are the differences between three port ?
Is it possible to do direct wiring termination to the RS485 terminal block provided by MangoES without a convertor?Any help will be greatly appreciated.![2_1456843109501_error1.jpg](Uploading 100%) ![1_1456843109500_modscan1.jpg](Uploading 100%) ![0_1456843109499_modscan2.jpg](Uploading 100%) ![alt text](image url)
-
I can't answer all your questions, but I do know that you can't enable the data source AND test using the buit-in tester.
You have to disable the data source if you want to test. Only 1 can run at a time.
-
HI Mihairosu,
Thanks for your valuable information.
I managed to get rid of the error message.However I observed that the port /dev/ttyUSB1 doesnt seem to be unreliable.
I did a test. port /dev/ttyUSB1 discover the node of RS485 devcie when you connect the first times. However after connect and disconnect a few times, modbus node scan cannot discover the same node.
port /dev/ttyUSB0 work perfectly no matter how many attempt you connect and disconnection.
Any thought?I also confirm that the RS485 terminal block does not work if you directly connected to RS485 device.
Does anyone know what type of device to be connected?Thanks
-
Hi Desmond,
I am guessing that you have a MangoES V2 (metal box). I am not certain I understand your description, does 'connect' mean unplug the USB and plug it back in?
The RS-485 port on a MangoES should work. Are you sure you have the port identifier correct?
Some of those units have an issue where the serial port can change enumerations between plugs or boots, i.e. /dev/ttyUSB0 --> /dev/ttyUSB1 && /dev/ttyUSB1 --> /dev/ttyUSB0. Similarly, you could perhaps convince it to enumerate something as /dev/ttyUSB2. This can be fixed by adding udev rules to provide a definite symlink to a port based on which physical plug was used. Here is the text you could place into a file in /etc/udev/rules.d/ perhaps a new one called 30-serial-port.rules
SUBSYSTEM=="tty", ATTRS{devpath}=="3.1", SYMLINK+="ttyACM91" SUBSYSTEM=="tty", ATTRS{devpath}=="3.2", SYMLINK+="ttyACM92" SUBSYSTEM=="tty", ATTRS{devpath}=="3.3", SYMLINK+="ttyACM93"
I believe these numbers increment from left to right, so 91 is the left USB port, 92 is the RS485, and 93 is the right. You may with to verify that on your own. The reason I use ttyACM is that prior to Mango 2.7 the serial port paths were hardcoded, and ttyACM was among them. Typically now I use ttymUSB (or RS485-1) and edit my env.properties file to add ttymUSB in the regex that discovers serial ports, serial.port.linux.regex
-
Hi Phildunlap,
Yes you are right. I have purchased a MangoES 2.7.2 build 465 (metal box).
For clarification purpose, there are 2 serial port. While experimenting the USB port, I change the serial port between plugs or boots, i.e. /dev/ttyUSB0 --> /dev/ttyUSB1 && /dev/ttyUSB1 --> /dev/ttyUSB0
Whichever the port is being plugged, it must change the assigned port selection from the drop down list and saved. By doing so, you can replicate the issue I have encounter.However I have 3 different file name and unsure how to edit. I also notice there isnt any env.properties file.
Refer to the attachments for details.Pls help.
Thanks
0_1457081801157_70-persistent-net.rules
0_1457081877654_20-snaplink.rules
0_1457081825719_10-odroid.rules -
You env.properties file is located at Mango/overrides/properties/env.properties to persist through upgrades and on an ES, Mango/classes/env.properties by default.