Sponsored Content
Top Forums Programming Arduino UNIX Time - Syncing Computer UNIX Time to Arduino Time with Python Post 303042446 by Neo on Wednesday 25th of December 2019 04:22:25 AM
Old 12-25-2019
As a side note:

I notice that when I use launchd and cron on my mac to keep an Arduino UNO in sync, that I cannot update the Arduino code though the IDE unless I unload the launchd file, stop the cron entry (actually, if fast do not need to modify cron) and power cycle the Arduino.

This takes more time than I like (unloading and loading launchd, editing and restarting cron twice, hard resetting the Arduino), so as a work around, I can update the Arduino on a different mac and then connect the updated Arduino back to the mac running launchd and cron on the required serial port. Note: If I'm fast, can get by not editing and restarting the crontab.

Today, I am experimenting with a 650nm (red) laser and was going to use this little laser to transmit and sync unix time to a remote receiver; but I don't have an optical receiver in my parts box yet.

I do have a long range RF transmitter and receiver in the mail from China, as well as a 3G module, so I maybe I'll transmit and sync unix time to my Ninja, for fun.

Actually, I need to think of some very cool, "science-project-like" Arduino project which is not already on YT or in the Arduino forums. I am thinking to do something with my motorcycle, time, position, and speed via 3G back to my home and store the results (tracking) in a database; but that sounds "too easy" Smilie (waiting on parts). Then I thought, I would create a RF network and transmit unix time as a beacon, but we have GPS for that. Haha....

Any crazy ideas (not already on YT)?
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help me!First time use UNIX.

I am assigned a programming work.It is my first time to use unix. The task is writing a shell script to interrogate the university Unix operating system to determine the number of "Runnable" processes at any given time.Then append the result,along with a time-stamp,on a log file. Also there are... (1 Reply)
Discussion started by: zhshqzyc
1 Replies

2. UNIX for Advanced & Expert Users

How To Provide Time Sync Using Nts-150 Time Server On Unix Network?

can anybody tel lme,how to instal NTS -150 on a unix network,it needs some patch to fetch time frm serve,,?? (2 Replies)
Discussion started by: pesty
2 Replies

3. Shell Programming and Scripting

Convert Unix Time to Standard Time

I have a list of interfaces and time the interface was last active. I can't figure out how to convert the time in the second column, Fa1/14 0 Se0/0/0 0 Fa1/11 0 Fa1/9 0 Fa1/0 0 Se0/0/1 1240401408 Gi1/0 0 Fa0/0 1240401408 Fa1/3 0 Fa1/8 0 Fa1/15 0 Fa1/13 0 Fa1/10 0 Fa1/1 0 Fa1/12... (7 Replies)
Discussion started by: mrlayance
7 Replies

4. Shell Programming and Scripting

Unix time

how do i convert unix time to show normal eg i have unix time 1297702242 and i want it converted to normal time. how do i do that (2 Replies)
Discussion started by: blackzinga80
2 Replies

5. Shell Programming and Scripting

How to get time duration between two human readable time stamp in Unix?

Here is two time I have: Jul 12 16:02:01 Jul 13 01:02:01 and how can I do a simple match to get difference between two time which is 09:00:00 Thanks in advance. (3 Replies)
Discussion started by: ford99
3 Replies

6. UNIX for Dummies Questions & Answers

Converting string date time to unix time in AWK

I'd like to convert a date string in the form of sun aug 19 09:03:10 EDT 2012, to unixtime timestamp using awk. I tried This is how each line of the file looks like, different date and time in this format Sun Aug 19 08:33:45 EDT 2012, user1(108.6.217.236) all: test on the 17th ... (2 Replies)
Discussion started by: bkkid
2 Replies

7. Shell Programming and Scripting

Adding time to date time in UNIX shell scipting

I needed some help in adding a duration (in seconds) to a start time (in hhmmss format) and a start date (in mmddyy format) in order to get an end date and end time. The concept of a leap year is also to be considered while incrementing the day. The code/ function that I have formed so far is as... (3 Replies)
Discussion started by: codehelp04
3 Replies

8. Shell Programming and Scripting

Convert UTC time into current UNIX sever time zone

Hi guys thanks for the help for my previous posts.Now i have a requirement that i download a XMl file which has UTC time stamp.I need to convert UTC time into Unix server timezone. For ex if the time zone of unix server is CDT then i need to convert into CDT.whatever may be the system time... (5 Replies)
Discussion started by: mohanalakshmi
5 Replies

9. Programming

Arduino-cli - Uploading to Unknown Chinese Arduino Boards using the Arduino Command Line Interface

In my further exploration of Arduino, today I decided to install the arduino-cli on my mac today. https://github.com/arduino/arduino-cli I followed the instructions for macOS but when I got to this part: arduino-cli board list I got the dreaded "Unknown" Fully Qualified Board Name... (1 Reply)
Discussion started by: Neo
1 Replies
launch(3)						   BSD Library Functions Manual 						 launch(3)

NAME
launchd APIs -- interfaces for interacting with a launchd job. SYNOPSIS
#include <launch.h> #include <servers/bootstrap.h> kern_return_t bootstrap_check_in(mach_port_t bp, const name_t service_name, mach_port_t *sp); int launch_activate_socket(const char *name, int **fds, size_t *cnt); DESCRIPTION
A launchd(8) job may have resources that are held on behalf of it while it is not running to facilitate launch-on-demand. These interfaces allow for the job to retrieve these resources as part of its initialization. Currently supported resource types are XPC listener connections, Mach ports, and sockets. Use of XPC with launchd(8) is documented in the xpc(3) family of manual pages. MACH PORTS
The bootstrap_check_in() routine allows for a launchd(8) job to retrieve the receive right to a Mach port that launchd(8) has created on behalf of the job. launchd(8) creates this port and advertises it in the appropriate Mach bootstrap namespace by parsing the MachServices entry of the job's launchd.plist(5). The first argument to bootstrap_check_in() should always be the bootstrap_port() global. The second argument should be the name of the service whose port you wish to retrieve, as specified as an entry in the job's MachServices dictionary. The final argument, upon successful return, will be the name of the receive right corresponding to the port that launchd(8) had advertised in the bootstrap namespace. If the job closes the receive right to the port with mach_port_mod_refs() or exits, the receive right obtained by this routine will be send back to launchd(8) rather than being closed. This allows launchd to resume advertising the same port in the Mach bootstrap namespace and frees clients from the need to re-query for the send right to that port when the job dies. SOCKETS
The launch_activate_socket() routine allows a launchd(8) job to retrieve a set of file descriptors corresponding to a socket service that launchd(8) has created and advertised on behalf of the job by parsing the Sockets entry in the job's launchd.plist(5). The first argument should be the name of the socket entry as specified in the launchd.plist(5). The second argument, upon output, will point to an array of integers whose count is filled into the third argument upon success. This array represents all the sockets that launchd(8) created corre- sponding to the entry in the job's Sockets dictionary. Depending on the properties specified, a single Sockets entry may have multiple descriptors created for it (one for IPv4 and one for IPv6, for example). This array is allocated on the heap, and it is the caller's respon- sibility to call free(3) to dispose of the memory when it is no longer needed. RETURN VALUES
If launch_activate_socket() succeeds, zero is returned. In the event of failure, a non-zero POSIX-compatible error code indicating the nature of the error is returned. This error may be decoded with strerror(3). If bootstrap_check_in() succeeds, KERN_SUCCESS is returned. In the event of failure, a non-zero error code that may be decoded with bootstrap_strerror(). ERRORS
bootstrap_check_in() will fail if: [BOOTSTRAP_UNKNOWN_SERVICE] The Mach service name specified does not exist in the caller's launchd.plist(5). [BOOTSTRAP_SERVICE_ACTIVE] The specified Mach service has already been checked in by the job. launch_activate_socket() will fail if: [ENOENT] The socket name specified does not exist in the caller's launchd.plist(5). [ESRCH] The calling process is not managed by launchd(8). [EALREADY] The specified socket has already been activated. SEE ALSO
xpc(3), xpc_connection_create(3), socket(2), launchd(8), launchd.plist(5). Darwin 31 March, 2014 Darwin
All times are GMT -4. The time now is 12:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy