Java Datagram problem | Thales IoT Developer Community
June 28, 2016 - 2:20pm, 5098 views
Hello,
Why do i get Invalid host Exeption when trying to enter url address in the following statment:
String server = "0.europe.pool.ntp.org";
Datagram sendDatagram = udp.newDatagram(buf, buf.length, "datagram://"+server+":123");
If i enter ip address in the server varible works just fine?
I even tried to add dns in connURL but no luck...
connURL.append(";dns=213.229.192.161");
Is there a dns problem or newDatagram throws exeption?
Regards,
T.
I have exactly the same be behavior of UDPDatagramConnection.
I think its not a DNS problem, bacause SocketConnection works just as expected with domain names in connection string.
Hope someone from Gemalto guys could coment this.
I'm using Bgs5T but i dont thik this is module issue...
The same code works on some other modules..
Can someone pls provide some hints or something ?
Tnx!
Hello,
I've verified and tested this - at the moment it is really true that only IP address can be used with datagrams. It has been already reported and is being processed.
But for now there is a workaround that could be used - there is a static method that can retrieve IP address from the host name:
NetExtension.Hostname(server);
Regards,
Bartłomiej
I will give it a try!
Tnx for now!
Hi,
Jp, that fixed the url issue!
Thank you!
Regards, T.
Now that we can sync time!
Is there any cron for midlet that you guys know?
Maybe http://www.quartz-scheduler.org/ will this work?
Tnx
Hello,
If you would like to use some external library you would need find some that is dedicated to J2ME to avoid or reduce to minimum the necessary adaptations. The Java on the module is based on 1.3. So you'd need to try and and see how much effort that would need. But maybe you don't need the whole library for this. The provided API should be enough for time synchronisation, for example Timer and TimerTask classes.
Regards,
Bartłomiej
Hi!
Are there any instructions how to upgrade module?
my current version :
ati
Cinterion
BGS5
REVISION 01.100
OK
ati1
Cinterion
BGS5
REVISION 01.100
A-REVISION 00.000.10
Hello,
Your version is not the latest.
You need a new firmware file. You can get it as runnable exe file that will update the firmware and JRC. Or there can be a separate usf firmware file and JRC MIDlet jar and jad files - then you can update the firmware with AT commands or implement a remote update. There is also a document for firmware update.
Generally you can request it from your local Gemalto support or sales person.
Regards,
Bartłomiej