Pc Communication | Telit Cinterion IoT Developer Community
September 15, 2016 - 10:04pm, 3475 views
Hello,
How to communicate with pc probably over serial port...
Using Bgs5T!
So my goal is to display simple data that are read from adc that is working fine,but i need it display on custom application due some fine tunings.
So what i was trying:
System.getProperty("microedition.commports")
I'm guessing that ASC0 = COM0(that debugger is using ) , ASC1 = COM1(Other port when drivers are installed) and USB0 = ??
So when i set the communication string "comm:COM0;blocking=on;baudrate=9600" COM0 and COM1 seems to be opened USB0 charshes the app.... but that is not the point!
So is there any way to astablish the communication with terminal and pc?
Also been trying with example taht is included:
System.out.println("RS232Demo: startApp");
System.out.println("Looping back received data, leave with 'Q'...");
try {
int ch = -1;
while(ch != 'Q') {
ch = inStream.read();
if (ch >= 0) {
outStream.write(ch);
System.out.print((char)ch);
}
}
} catch(IOException e) {
System.out.println(e);
}
System.out.println();
And also System.out.print((char)ch) in my guess is sending data over serial...
I'm assumning that this command sets it : AT^SCFG="Userware/Stdout","ASC0"
So my final goal would be to astablish two way communication with tunning software and terminal!
I'm stuck couse i cant detect any data from terminal rather that sending at command and and getting output on debugg console!
Any Hints?
Reagrds,
T.
Hello,
System.getProperty("microedition.commports") can show you the available COM ports on the module.
If you are using the on device debugging (debug or run the MIDlet form Eclipse or NetBeans) probably one of the USB's is used but ASC0 is also possible - you can see it in the log.
You're right that ASC0 is COM0 and ASC1 is COM1. If USB0 causes the crash maybe it is the port used by the debugger. System.out.print prints to the interface configures with AT^SCFG="Userware/Stdout" command. So it is not the best idea to use the same interface for CommConnection - it should also work but you have the mixed output.
The RS232Demo is a good app for testing. For USB please check the mappings in Device Manager - you will see under Ports the module's USB interfaces mapped to the COM ports of the PC. USB0 will be under Modems.
You should also be aware that when you reboot the module all USB connections to the module should be closed on PC - otherwise the USB interfaces will not enumerate after reboot.
Best regards,
Bartłomiej