Hi Ian,

You could set it up either way, the webserver on the desktop with a curl
script on the client or the other way around with the webserver on the
client.

Unless you need the webserver on the client for other purposes I would just
use wget (or curl or even plain netcat) to pull a URL from the desktop.

The webserver on the desktop would respond on a specific URL (eg. '/date')
with its current timestamp in a usable format (eg. 'YYYYMMDDHHMM').  This
can be done using SSI and the Unix 'date' command (eg. 'date +%Y%m%d%H%M').

The client would pull this URL (eg. 'http://desktop/date'), parse the date
from the body and locally feed it into the 'date' command.  It could also
write the last received date to a file and parse it on startup, so that in
case the desktop is not responding the default date/time is at least a
little more current than 1970-01-01.

HTH,
/uli


On Wed, Jan 15, 2014 at 7:46 AM, ian carreno <[email protected]> wrote:

> Hi,
>
> Thanks for the replies.
>
> Here is the hardware setup.
> 1. Embedded hardware connected peer-to-peer network with the Desktop PC.
> 2. Embedded hardware does not come with the display panel and battery for
> RTC.
> 3. The GUI for the Embedded hardware is only the webpage that can be shown
> in Desktop PC.
> 4. Embedded hardware is data acquisition hardware that log all the acquire
> data and that needs for the correct date and time.
>
> The NTP is not an option for this since it is not connected to the network
> infrastructure. That is why, I need to  transmit the date and time from
> Desktop PC silently to Embedded Hardware for the purpose to have date and
> time on the acquired data log.
>
> Again, Thanks to all.
>
> ian
>
>
> On Tue, Jan 14, 2014 at 7:06 PM, Ulrich Hertlein <[email protected]>wrote:
>
>> Hi Ian,
>>
>> You should definitively read up on how server-side code (SSI, PHP, etc)
>> and client-side code (JavaScript) are to be used and how they can interact.
>>
>> The SSI code is executed on the server, before the reply is sent to the
>> client -- the JavaScript code is executed on the client and is never
>> executed on the server.
>>
>> SSI can be used to inject server-side information into a web page.
>> JavaScript can be used to perform calculations on the client, like
>> modifying the loaded page or send requests back to the server.
>>
>> What are you trying to achieve?  Do you want to transmit the local client
>> time to the server (for some purpose) or do you just want to display the
>> client time in the page?
>>
>> Cheers,
>> /uli
>>
>>
>> On Tue, Jan 14, 2014 at 6:50 PM, Natko <[email protected]> wrote:
>>
>>>
>>> Hi,
>>> are there any reasons not to use NTP or SNTP for time synchronization?
>>>
>>> Natko
>>>
>>>
>>> On Friday, January 10, 2014 3:41:04 PM UTC+1, yana wrote:
>>>>
>>>> Hello,
>>>>
>>>> I am just new to mongoose and amazed with this very light server. I
>>>> have setup the mongoose on the embedded arm hardware connected to the
>>>> network and it works fine. :-) I can access the server from the client
>>>> computer through web browser.
>>>>
>>>> Now I would like to send the current client local time to the server
>>>> using SSI. I played around  <!--#exec "date --set '2014-01-10
>>>> 11:13:13"--> and works ok but the date is hardcoded. I have read the
>>>> mongoose manual and say only the following SSI are supported.
>>>>
>>>>
>>>>    - <!--#exec "shell command"--> Execute shell command.
>>>>
>>>>
>>>>
>>>>      o      <!--#include "path"--> File path must be relative to the 
>>>> current doc-
>>>>     ument.
>>>>
>>>>      o      <!--#include virtual="path"--> File path must be relative to 
>>>> the doc-
>>>>     ument root.
>>>>
>>>>      o      <!--#include file="path"--> File path must be the absolute 
>>>> path.
>>>>
>>>>
>>>> Is there anyway way that we could get the client current time using SSI
>>>> tag? and pass it to exec tag such way the server will sync with the client
>>>> time?
>>>>
>>>> Best Regards,
>>>> Ian
>>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "mongoose-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/mongoose-users.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "mongoose-users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/mongoose-users/y1_OuXl01lc/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>>
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/mongoose-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "mongoose-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/mongoose-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to