B4J Question Automatic Date and Time with NO Internet

Harris

Expert
Licensed User
Longtime User
My tablets are Wifi only.
I had to disable internet on the server because operators were abusing it. Only my app should run and I don't need all other apps updating themselves when never used antway.

The problem is: now clocks drift and have no way to sync with pool.ntp.org.

Anyone have a similar issue and resolved?

I can use GPS lib to get atomic time, compensate for timezone offset - BUT I must have user make the adjustment since setting it myself thru code is foreboden (the extent of my German)...

Like to here your comments.

Thanks

EDIT: This may get more hits in the Android section?

Edit2: Does anyone know what NTP a Samung tablet (Ative 8 - wifi only) uses? pool.ntp.org OR 2.adndroid.ntp.org? Or how deos one find out. Mr. Google does not seem to be helpful in this regard.
 
Last edited:

OliverA

Expert
Licensed User
Longtime User
Configure server to only have it use internet. If necessary, block all traffic that is not necessary and only allow NTP and any other services needed.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Configure server to only have it use internet. If necessary, block all traffic that is not necessary and only allow NTP and any other services needed.
Can you elaborate?
Do you imply: only allow the Windows 2012 R1 server to have internet access, AND only allow it to see (the ports) that provide NTP?
Cool, but how? Our friend, Mr. Google knows?

Thanks
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Is the server connected directly to the internet, or does it have to go through a router? If directly, then configure the internal firewall and turn off internet sharing (and yes, Google will be your friend). If it has to go through a router, configure the router to only allow traffic from the server through (both ways) and then only for certain traffic.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
Is the server connected directly to the internet, or does it have to go through a router? If directly, then configure the internal firewall and turn off internet sharing (and yes, Google will be your friend). If it has to go through a router, configure the router to only allow traffic from the server through (both ways) and then only for certain traffic.

It goes thru a router alright... A corporate one.... The IT support from this company is watching this thread - so hopefully this makes sense to them - since it is mainly Greek to me...

Thanks @OliverA
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
From what I know, being the server behind a corporate router, it should then have a fixed IP and should be possible to:
In the server side, limit the traffic to the NTP, using the server's firewall, And tunnel the routers firewall for that IP, so that it can only "talked" to that specific NTP
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
From what I know, being the server behind a corporate router, it should then have a fixed IP and should be possible to:
In the server side, limit the traffic to the NTP, using the server's firewall, And tunnel the routers firewall for that IP, so that it can only "talked" to that specific NTP
Yes, my server does have a fixed IP. It is also config'd as a VLan (virtual lan? - if that matters - I don't know).

In the server side, limit the traffic to the NTP, using the server's firewall - this should be possible since it is my server (well for my product - server owned and managed by my client).

And tunnel the routers firewall for that IP, so that it can only "talked" to that specific NTP - here, they may have an issue - but I don't understand the (legitimate?) reason why... (cause I am network, router, implication stupid).

Thanks for your input and advice... everything helps - and SOMETHING has to work!

It is imperative that the clocks be accurate - and they are not right now. Some could be off by seconds - other by days or weeks / months!
The devices are used to record production values (weight amount of product hauled). If product hauled today was time stamped as last week (or even yesterday) - the daily production report (for today) would not include this amount - and my ass will be new mowed grass!!!
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
This suggestion may be completely dumb, but how about an "in situ" precision clock?
I mean an hardware solution, connected to the network, which only job would be, keep track of (precision) time?
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
This suggestion may be completely dumb, but how about an "in situ" precision clock?
I mean an hardware solution, connected to the network, which only job would be, keep track of (precision) time?
NTP would be fine if I could get it.
It's not my network - and it is a huge network for a large mining operation. Everything is locked down and managed to the nth...
Considering anything for it must pass 5 executive meetings, 4 board approvals and 3 Hail Mary's... if you know what I mean.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
1) Server: If this is not the only server on the network, you could point this servers time source to another server on the network. That would get rid of the requirement to contact the outside. You just need to find another server in the network that provides time.

2) Tablets: are they also having time issues or is it only the server?
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
The server is fine. It syncs to a NTP on the network.
It is just, and has always been - the tablets.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Maybe programmatically (https://stackoverflow.com/a/18104950). Both this the the previous suggested way require root, so either one could resolve the issue. If you could put it into your software or a separate app, that may give you some more control of the NTP requests.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
require root

I shall not root. I need stock devices since I am not (always) here to recover devices that go south and need re-flashing (wipe clean and start over). Anything extra managers would have to do becomes an arduous issue. There are enough steps already to prepare a tablet to function as an OBC (on-board computer).

I need it to work as if an internet connection was available to the device - open ports and allow NTP to go thru seems like the solution that we shall try when IT gets back on site.

Thanks
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
open ports and allow NTP to go thru seems like the solution that we shall try when IT gets back on site
That would be the least intrusive and probably the simplest solution and one less thing on your plate. You can then once more concentrate on your application and what it does instead of the overall network security/accessibility. It’s amazing what one can control with nice router/switche/network hardware.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
It’s amazing what one can control with nice router/switche/network hardware
Yes, they have it all - and then some... They also have a large (centralized off-site) network support team that needs to understand our imperatives - and investigate.
If this cannot be accomplished to their satisfaction (minimal threat to their secure network), then I shall implement Plan B. Thankfully, the local IT support understands and bends over backwards to try and accommodate - within their limited means.

That said, I must / do respect that this company is one of the world's largest mining conglomerates - with operations spanning the globe. Every minor request (for network mods) must be carefully considered on the whole, since a wrong move could be potentially disastrous to their overall operations. I certainly would not want to be the root cause of that! I must tread softly - if I expect to be invited back as a supplier of these technologies.

Thanks for your input, It helps.
 
Upvote 0

MrKim

Well-Known Member
Licensed User
Longtime User
Not sure what you are trying to acomplish but I will tell you what I did in a similar situation. It sounds like you are saying the server time is correct. If that is not true this won't help.
I have a data base app (SQL Server) and we are frequently writing time sensitive records, so I always get the time from the server with query and that is what I use.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User
I always get the time from the server with query and that is what I use
Sure, that is one method. However, if you can not set the time on the device with this (correct) server time, your hooped. Such is the case since Android will not let me set the device system time via code. NTP or die... (or plan B as explained above...).

Thanks
 
Upvote 0
Top