Java Datagram problem | Thales IoT Developer Community
June 28, 2016 - 2:20pm, 5098 views
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...
Is there a dns problem or newDatagram throws exeption?
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 ?
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:
I will give it a try!
Tnx for now!
Jp, that fixed the url issue!
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?
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.
Are there any instructions how to upgrade module?
my current version :
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.