09-11-2024 12:23 AM - edited 09-11-2024 12:24 AM
Hello community,
I'm encountering an issue while trying to run an RS485 Modbus RTU script on a Cisco IR1835 router. The script is designed to collect flow sensor data and send it to Azure IoT Hub. I'm hoping someone can help me troubleshoot this problem.
Background:
Issue: We're encountering an error at the serial.Serial function. The script is attempting to use the serial port defined by the HOST_DEV1 environment variable, which should map to /dev/ttySerial1 on the IR1835.
We've done some debugging by entering inside the container and deploying dummy scripts, but we're still facing issues.
attached the screenshot of debugging inside iox app and running config
Our use case is to collect flow sensor data via Modbus RTU and transmit it to Azure IoT Hub for further processing and analysis.
Has anyone encountered similar issues or have suggestions on how to resolve this? Any assistance would be greatly appreciated.
Thank you in advance for your help!
Solved! Go to Solution.
10-11-2024 05:43 AM
Hello,
Since you are using /dev/ttySerial1 can you please try to configure:
relay line 0/2/1 0/0/1
(you currently have "relay line 0/2/1 0/0/0")
09-11-2024 02:00 AM - edited 09-11-2024 02:00 AM
Hello,
IR829 was using Classic IOS, while IR1835 runs IOS-XE. A number of changes have been done under the hood, such a removing the Hypervisior and running IOx directly on the underlying Linux kernel. That being said this should work, so let's investigate.
First of all all have you configured the required commands in IOS-XE config to enable passing the serial data to IOx?
https://www.cisco.com/c/en/us/td/docs/routers/access/IR1800/software/b-cisco-ir1800-scg/m_serial-relay.html
Can you read data using non-Python commands? (such as "cat")
Thanks,
Emmanuel
09-12-2024 05:59 AM - edited 09-12-2024 06:03 AM
Thanks for your response.
we tried with non python command .
serial data was simulated but still not able to access the serial port.
in dockerfile the base image is arm64v8/python:3.11-slim-buster.
also in config i have the below things.
interface Async0/2/1
no ip address
encapsulation relay-line
media-type rs485
half-duplex
!
line 0/0/0 0/0/1
line 0/2/0 0/2/1
line vty 0 4
login
length 0
transport input ssh
line vty 5 14
login
transport input ssh
!
relay line 0/2/1 0/0/0
10-11-2024 05:43 AM
Hello,
Since you are using /dev/ttySerial1 can you please try to configure:
relay line 0/2/1 0/0/1
(you currently have "relay line 0/2/1 0/0/0")
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide