BGS5T serial communication issues | Telit Cinterion IoT Developer Community
January 20, 2015 - 12:26am, 10444 views
Hello,
I've written TCP/IP to serial modbus protocol 'gateway' for BGS5T module, but cannot get it completelly working due to serial communication. My setup:
BGS5T modem, power saving disabled, Userware/Stdout set to null, using this connection string:
"comm:COM0;baudrate=9600;parity=none;blocking=off;autocts=off;autorts=off" (tried many other variants as well, including stopbits, databits, ... etc.)
1)
- BGS5 connected trough serial<-> usb converter cable to pc;
- Modbus simulator runs on the pc, opened serial port for communication, I have some simulated data entered in it
Result: everything's just fine. I can get those simulated values from serial port and send it back as a modbus TCP response to connected client via BGS5.
2) I have two different PLCs (twido and unitronics jazz). If I connect those directly to the same rs232<->usb cable to the same PC (same rs232 params as defined above in connection string) on serial port and scan the values from them (using 03 modbus function etc.) everyting's also just fine.
Now important part: both PLCs are DCE devices (have female serial port/cable) also the BGS5T is DCE/female device. So, connecting BGS5 to PLC requires "gender changer" / null modem converter. I have original converter especially used for that, and also bought DB9:male<=>DB9:male cable.
Problem: Whatever I use, I cannot get any PLC to respond to serial data sent to it. I am 100% guaranteed that data is sent (connected to terminal and got the exact HEX values I am expecting). Tried male/male converter, cable, also I've cut and rewired the cable Rx/Tx (made it crossed). Nothing works.
Question: Are there any rules I should fulfill using serial port (RTS/DTS signals etc.), or maybe you have any insights/suggestions. Any special wiring must be fullfilled (f.e. null modem cannot be used for some reasons)? I would really appreciate it. It's 3rd day I cannot sleep anymore... :)
Please make sure that you are sending the <CR> character after each command. It should be able to configure it in the terminal program options.
If you are using the USB to serial converter - sometimes such devices may also cause problems.
Please also check the modem interface (under Modems in Device Manager).
Hi again.
I finally managed to send ATCommands.
Here are the answers to the commands you asked:
AT^SCFG?
AT^SCFG?
^SCFG: "Call/ECC","0"
^SCFG: "GPRS/AutoAttach","enabled"
^SCFG: "Gpio/mode/ASC1","std"
^SCFG: "Gpio/mode/DAI","gpio"
^SCFG: "Gpio/mode/DCD0","std"
^SCFG: "Gpio/mode/DSR0","std"
^SCFG: "Gpio/mode/DTR0","std"
^SCFG: "Gpio/mode/FSR","gpio"
^SCFG: "Gpio/mode/PULSE","gpio"
^SCFG: "Gpio/mode/PWM","gpio"
^SCFG: "Gpio/mode/RING0","std"
^SCFG: "Gpio/mode/SPI","rsv"
^SCFG: "Gpio/mode/SYNC","std"
^SCFG: "Ident/Manufacturer","Cinterion"
^SCFG: "Ident/Product","BGS5"
^SCFG: "MEShutdown/Fso","0"
^SCFG: "MEopMode/SoR","on"
^SCFG: "Radio/Band","15"
^SCFG: "Radio/OutputPowerReduction","4"
^SCFG: "Serial/Interface/Allocation","1","1"
^SCFG: "Serial/USB/DDD","0","0","0409","1E2D","0059","Cinterion Wireless Modules","Cinterion BGx USB Com Port",""
^SCFG: "Tcp/IRT","3"
^SCFG: "Tcp/MR","10"
^SCFG: "Tcp/OT","6000"
^SCFG: "Tcp/WithURCs","on"
^SCFG: "Trace/Syslog/Otap","0"
^SCFG: "URC/Ringline","local"
^SCFG: "URC/Ringline/ActiveTime","2"
^SCFG: "Userware/Autostart","1"
^SCFG: "Userware/Autostart/Delay","0"
^SCFG: "Userware/Passwd",
^SCFG: "Userware/Stdout","null",,,,"off"
^SCFG: "Userware/Watchdog","0"
OK
Serial port COM1 closed
AT^SPOW?
^SPOW: 2,1000,3
OK
The thing is that now that I can send ATCommands, I can't interact with the code I made, or so to say, send strings via RS232 and receiving them in the RS232Demo. Is this due to operating in different modes? How do I alternate between different modes? Before, I was able to send strings to the program such as "test" and see them being printed on the other side of the connection. In the terminal i sent the message and got and an echo. Now everything i can do is send AT Commands. It seems that I have changed the way that the modem is behaving and I don't have a clue how to change it.
Thanks.
Hello,
So you can send AT commands - that's good. If you are able to do that on ASC0 interface (COM0 in your Java code) your application should also work (you will not be able to execute AT commands while the application will be running). There is a power saving on UART interfaces active - the communication on ASC0 would not work without the hardware flow control then. I'd recommend you to disable the power saving to improve the communication performance with setting AT^SPOW=1,0,0.
If you start your application now it should connect to the ASC0 port and you should be able to get the text you send echoed. You should also configure the system out interface for your application to see the debug messages and exceptions. You can do that with AT^SCFG="Userware/Stdout","usb" or AT^SCFG="Userware/Stdout","asc1".
Regards,
Bartłomiej
Hey Bartlomiej,
As you could see by another topic, I realized that i should change the power saving mode. Made a mistake and typed to the 0 mode instead, deactivating the usart ports instead. As soon as I fix that, I will post the results to see if my problem was fixed!
Edit: I changed the power saving mode to 1,0,0.
Executed the AT^SCFG="Userware/Stdout","usb" line aswell.
Still can't receive anything in the java application.
Regards
And were you able to see any debug from the application? Maybe you have made some changes and that's the reason why it's not working. In such case please try to use the original RS232Demo MIDlet. Is there any other application that is running on the module?
I noticed the problem. Somehow, running the project in Eclipse rather then Netbeans solved the issue.
I'm now able to send the string and send ATCommands when not running a program.
I'll make a clean new install of Netbeansto settle it.
Thank you so much for your help, Bartlomiej.