Open-Smartwatch / open-smartwatch-os

The Open-Smartwatch Operating System.
https://open-smartwatch.github.io
GNU General Public License v3.0
993 stars 161 forks source link

More data-based services / APIs #207

Open RuffaloLavoisier opened 2 years ago

RuffaloLavoisier commented 2 years ago

I would like to provide information to Watchface.

TO-DO:

I think it is possible to extract sufficiently valuable data by storing user information(height, weight) that needs to be received by the Open-smartwatch in config.h or OSW config.


Related issue :

RuffaloLavoisier commented 2 years ago

See https://github.com/Open-Smartwatch/open-smartwatch-os/pull/223

RuffaloLavoisier commented 2 years ago

It's time to restart this part.

Lorenzosciacca commented 2 years ago

weather_app_render I’m working on a weather app for OSW, right now I’m able to perform a get to Open Weather map. The connection requires https and also an API key, anyway, there are also other services with less requirements. The data that I get with the API call are stored in the NVS using my own encoding. The encoder is capable to compress 24 updates ( weather code, temperature, humidity, pressure) in 76B. In particular, the encoding of humidity and temperature is lossy, pressure and weather code are encoded in a lossless way instead. The losses introduced are quite negligible for this kind of application.
The main idea is to update the weather on a daily base, doing it more frequently does not make a lot of sense for me. How do you think to get weather data? Do you think that using a free service (with mandatory subscription ) like openweathermap is a good idea?

simonmicro commented 2 years ago

@Lorenzosciacca I think this is a GREAT idea and - from the looks - beautiful implementation! I think using openweather is OK, as e.g. https://github.com/sqfmi/Watchy/blob/5690db077f5c99c7823cb652009bc260605b231f/examples/WatchFaces/7_SEG/settings.h#L6 is also doing that. I'm very impressed!

RuffaloLavoisier commented 2 years ago

@Lorenzosciacca If you want, could you implement this weather part?

Lorenzosciacca commented 2 years ago

@simonmicro thank you! @RuffaloLavoisier , of course, it will be a pleasure for me.

RuffaloLavoisier commented 2 years ago

@Lorenzosciacca Thank you in advance ☺

Lorenzosciacca commented 2 years ago

flash update: this is how the app looks like now. While i was playing with the smartwatch the screen died, it’s the usual problem but this slowed down everything. In the next future, when I will be able to do a couple of tests, I will post everything.

https://user-images.githubusercontent.com/60114811/189479755-361d1fea-7265-46be-91ac-520c34bfa87e.mp4

mat942 commented 2 years ago

Looks great, love the UI!

Lorenzosciacca commented 2 years ago

The app is available here. Note: there is a bug, when i try to perform the GET to openweather i can't enable the wifi directly from the app, instead it's necessary to enable the WiFi from the webserver/time-update app. I don't know the exact reason, it also may be related to the usual WiFi problems.

RuffaloLavoisier commented 2 years ago

@Lorenzosciacca Could you open the pull request?

Lorenzosciacca commented 2 years ago

Yes, i can, now i'm not at home, tomorrow morning i can do It for sure. On develop right?

RuffaloLavoisier commented 2 years ago

Yes, correct