GithubHelp home page GithubHelp logo

findmyhistory's People

Contributors

fjxmlzn avatar jkua avatar rempairamore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

findmyhistory's Issues

Basic queries and log folder

Sorry for the amateur question. I am a beginner in apple world and also terminal and macbook. I understand that the terminal is similar to commander in windows, but I don't understand the connections exactly yet. Like github, it is unknown to me.

I downloaded the zip file, allowed terminal access to the folders and ran the code using the code. The script obviously logs all my devices, shows how many updates there have been and the update time. So everything works. But I have a few basic questions and would like an amateur and simple explanation.

  1. I always have to run the script using that complicated code in the terminal. Is it not possible for main.py to function as an exe file simply to run?
  2. How to terminate the program? Just close the terminal, everything is always saved?
  3. Absolutely basic question. The help says that everything is saved in the "log" folder in the CVS file. But where should I look for this folder??? It's nowhere. I've looked everywhere, but the folder with the logo doesn't exist. It was not created even after closing the terminal.
  4. When the position saving script is running, where should I write --help if it is not possible to write in that window and the next terminal window cannot be started?

I really apologize for the amateurism.

Past History

Hello, Im really sorry if my question bother, I never coded before.
I’m using this code because I put an Airtag on my bike and it was stolen but I don’t precisely know when. It works perfectly for me, but I would like to know if it’s possible to find the logs of before you create the code on your Mac, and find at least the day when my bike changed country (it was at least a month ago). If yes, Is it possible to explain it to me ?
Thank you for your time ! (and sorry if my english is poor)

Nextcloud PhoneTrack App Intergration & visualization

I think this would provide an easy visual interface for people to follow the AirTags.

This is the Nextcloud App
https://apps.nextcloud.com/apps/phonetrack

This is the Page for Clients to send updates to the APP.
https://gitlab.com/eneiluj/phonetrack-oc/-/wikis/userdoc#logging-methods

It has a built in Post/Get option for adding History Points I am sure there are other options.

"HTTP request
You can build your own logging system and make GET or POST HTTP requests to PhoneTrack.
Here is an example of logging URL with POST:
https://your.server.org/NC_PATH_IF_NECESSARY/index.php/apps/phonetrack/logPost/TOKEN/DEVNAME
and with GET:
https://your.server.org/NC_PATH_IF_NECESSARY/index.php/apps/phonetrack/logGet/TOKEN/DEVNAME
The POST or GET parameters are:

lat (decimal latitude)
lon (decimal longitude)
alt (altitude in meters)
timestamp (epoch timestamp in seconds)
acc (accuracy in meters)
bat (battery level in percent)
sat (number of satellites)
useragent (device user agent)
speed (speed in meter per second)
bearing (bearing in decimal degrees)
"

Great Work on the Apple side..

Does anyone know how to interpret location|horizontalAccuracy?

In the log files, there's a field location|horizontalAccuracy which one might infer the meaning of, but doesn't have units, doesn't seem to be a percentage, so I'm wondering if anyone has any insight into how to interpret it?

I've seen values between 15 and 410 in some recent data logs, but mostly it hovers around 50-ish.

We're trying to locate a lost AirTag in a complex postal sorting machine, and any clues to get us a more accurate fix would be very helpful!

curses.error when running as a service, main.py seems fail when it can't output to a terminal

I'm using this handy guide to have main.py run as a service. I want main.py to run when the Mac is booted. One quick thing to note, to make this work I had to go into the Security and Privacy settings on Mac and give Python full disk access.

When I try to run main.py as a service, I get this error:

Traceback (most recent call last):
  File "/Users/boda/Documents/FindMyHistory/main.py", line 125, in <module>
    curses.wrapper(partial(main, args=args))
  File "/usr/local/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/curses/__init__.py", line 73, in wrapper
    stdscr = initscr()
             ^^^^^^^^^
  File "/usr/local/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/curses/__init__.py", line 29, in initscr
    setupterm(term=_os.environ.get("TERM", "unknown"),
_curses.error: setupterm: could not find terminal

When I run main.py directly from the terminal I don't get this error. I can't figure out what's going on. When I run echo $TERM I get xterm-256color.

I think this might be an issue with the curses package, but I'm not familiar with how it works. Is it possible to modify the last line of main.py curses.wrapper(partial(main, args=args)) so that it doesn't fail if it can't output the result to a terminal?

Full Disk Access issue

I've granted it access in the Security settings and I've tried to add 'sudo' in the commandline but I cant get it to work.

sudo git clone https://github.com/fjxmlzn/FindMyHistory.git cd FindMyHistory pip3 install -r requirements.txt python3 main.py Password: fatal: destination path 'FindMyHistory' already exists and is not an empty directory. Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: tabulate[widechars] in /Users/yasingunaydin/Library/Python/3.9/lib/python/site-packages (from -r requirements.txt (line 1)) (0.9.0) Requirement already satisfied: wcwidth in /Users/yasingunaydin/Library/Python/3.9/lib/python/site-packages (from tabulate[widechars]->-r requirements.txt (line 1)) (0.2.13) WARNING: You are using pip version 21.2.4; however, version 24.0 is available. You should consider upgrading via the '/Library/Developer/CommandLineTools/usr/bin/python3 -m pip install --upgrade pip' command. Traceback (most recent call last): File "/Users/yasingunaydin/FindMyHistory/main.py", line 125, in <module> curses.wrapper(partial(main, args=args)) File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/curses/__init__.py", line 94, in wrapper return func(stdscr, *args, **kwds) File "/Users/yasingunaydin/FindMyHistory/main.py", line 91, in main log_manager.refresh_log() File "/Users/yasingunaydin/FindMyHistory/lib/log_manager.py", line 83, in refresh_log items_dict = self._get_items_dict() File "/Users/yasingunaydin/FindMyHistory/lib/log_manager.py", line 60, in _get_items_dict raise RuntimeError(f'No devices found. Please check if Full Disk ' RuntimeError: No devices found. Please check if Full Disk Access has been granted to Terminal. yasingunaydin@Air-van-Yasin FindMyHistory %

Missing ~/Library/Caches/com.apple.findmy.fmipcore/

I have a mac that was unning Ventura. FindMy shows my AirTags in in "Items" but there is no ~/Library/Caches/com.apple.findmy.fmipcore/ directory.

I upgraded to Sonoma and there is still no ~/Library/Caches/com.apple.findmy.fmipcore/ directory

Anyone have any ideas for me ?

Fix the _save_log function (sanitize filename)

My device name was:

MyName's iPhone iOS 7.1.1 (06/24/14)

This caused an issue in generating file paths with special characters and spaces in the filename.

File "/Users/tylerhall/Downloads/AIRTAGS/FindMyHistory-main/lib/log_manager.py", line 74, in _save_log
    with open(path, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: "log/2023-08-23/MyName's iPhone iOS 7.1.1 (06/24/14)__NULL.csv"

Here is my proposed fix in log_manager.py's _save_log function.

Here's the modified log_manager.py file that includes the _sanitize_filename function to handle filenames with spaces and special characters:

` def sanitize_filename(self, name):
# Replace spaces and special characters with underscores
return name.replace(' ', '
').replace('/', '').replace('\', '')

def _save_log(self, name, data):
    log_folder = self._log_folder
    if not self._no_date_folder:
        log_folder = os.path.join(
            log_folder, datetime.now().strftime(self._date_format))
    if not os.path.exists(log_folder):
        os.makedirs(log_folder)
        
    sanitized_name = self._sanitize_filename(name)
    path = os.path.join(log_folder, sanitized_name + '.csv')
    
    if not os.path.exists(path):
        with open(path, 'w') as f:
            writer = csv.writer(f)
            writer.writerow(self._keys)
            
    with open(path, 'a') as f:
        writer = csv.writer(f)
        writer.writerow([data[k] for k in self._keys])
        `

You can add the _sanitize_filename function to your existing LogManager class to handle filename sanitization. The function replaces spaces, slashes, and backslashes in the name with underscores to create a valid filename.

This modification should help you avoid issues with special characters and spaces in the filenames when creating the CSV files. Just ensure that this updated log_manager.py file is used in conjunction with the rest of your code.

Help command-line option doesn't work

Using the -h or --help option produces no output, displays "keyboard interrupt".

MacOS Ventura 13.0.1, 2020 iMac 27"

Possibly could be related to my use of Karabiner-Elements? (Keyboard remapper)

https://karabiner-elements.pqrs.org/

I was able to successfully use the --no_date_folder option.

Wanted to look at the exact usage of file naming option. No biggie, will look at source code...

Home assistant integration?

Hello,
I was able to set up your script on my MacBook like a charm. I guess I will be also able to read the csv from homeassistant if I put the csv to some shared folder. However, that's not exactly the way how we should set up our smart home.

Do you plan to rewrite it as an integration for HACS?

I would be really great! Especially if something is to be residently listening, we should use server-like set up. What do you think?

iPad support

It appears you can run python on an iPad with the right app. Has an iPad been tested? I’m considering buying an iPad so I can try this on it. But I figured I’d ask first. For that matter could it work on an iPhone?

Idea to synchronize & visualize the data?

Hi fjxmlzn & folks,

I am impressed with your script! I installed it on a MAC VM on a Unraid server & it works great. In fact, I had a break-in the other day and was able to track down the stolen goods using the airtags!

But now I was looking for a solution to save the history. Your script is great for this.

The question now is, how to visualize the data best (live). In the case of a theft, it is of course a bit more complicated to make maps of all days, etc.. manually.

Grandios would be a map where you can select the times to display the positions. I have done this with Mapbox, Atlist Maps and Google My Maps. However, not yet with a live ingest. Now I thought about synchronizing the CSV data with a Google Spreadsheet and then loading it into a map. This works. But it is very uncomfortable.

Do you have an idea for an approach how to visualize the data best? If possible even "live"? So that the data is automatically synchronized. I would have thought about writing the CSV data into a MySQL database or converting it into json etc... To synchronize with a server. However, I have not quite found which MAP could be suitable for this.

I would be very grateful for any approach or idea. If I find a way in the meantime I would of course post it here.

Best
Julian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.