RS232Demo stuck on read() | Telit Cinterion IoT Developer Community
July 1, 2019 - 3:23pm, 1832 views
Hi,
I was looking at the RS232Demo. The setup I have is to connect the concept board via USB to PC and experiment the demo using Eclipse. I'd like to read the System.out inside the IDE for now. I modified the demo to just simply send one byte and read one byte using the javax.microedition.io.CommConnection API. Writing is fine, no exceptions, however during read(), there was no data coming through and is stuck on the method call, waiting. I would expect to read the byte that was written. Is my setup or understanding of the CommConnection API incorrect?
SPOW is set to always on, and as for SCFG, I copied the following settings:
^SCFG: "Serial/Interface/Allocation","1","1"
^SCFG: "Serial/USB/DDD","0","0","0409","1E2D","0058","Cinterion Wireless Modules","EHx",""
^SCFG: "Userware/Stdout","null",,,,"off"
Thanks.
Hello,
Was it working before applying your modifications? Are you running it from Eclips or manually? If manually, please configure "Userware/Stdout". The default app connects to ASC0 interface. So you need to connect the ASC0 from ConceptBoard also.
If my understanding is correctly your app sends data on serial interface and waits for it to comen back. For this scenario you'd need something on the other side of the line to loop the data back.
Thanks. I am running from Eclipse via USB connected to a PC. Are you sying I must run another cable and connect the ASC0 to a PC and run a terminal program from there to test? I thought we could view activity from that API with or without connecting a device.
Hello,
If you are accessing a physical interface from your MIDlet with javax.microedition.io.CommConnection API (RS232 or USB) it will not loop back the data you send. You can open a terminal on this interface and check if anything comes. You can also write back.
You can check the available ports by executing the following code in the MIDlet:
System.getProperty("microedition.commports");
The example output can be as follows:
COM0,USB0,USB3,USB4,USB5
COM0 in java is ASC0 interface, COM1 is ASC1 interface. You will find the mappings in 'Device Manager' in Win if you want to connect to this port from PC.
Regards,
Bartłomiej