kizniche / ttgo-tbeam-ttn-tracker

TTGO T-Beam Tracker for TTN Mapper and TTN Tracker using US (915 MHz) and EU (868 MHz) frequencies
https://kylegabriel.com/projects/2019/04/lorawan-tracker-and-mapper.html
GNU General Public License v3.0
265 stars 139 forks source link

WIP for deep sleep support #13

Open geeksville opened 4 years ago

geeksville commented 4 years ago

Hi,

I just found your great project and I'm going to use it as a starting point on my LORA futzing. Alas, I've just ordered my TBEAMs from china and begun refactoring to allow me to use the axp192 (and the ssd sleep command) to have the device sit in deep sleep most of the time. My devices won't be here for a couple of weeks, but once they arrive and I test the changes I'll send you a PR.

However, if you are interested in trying deep sleep before then, here's my WIP branch: https://github.com/geeksville/ttgo-tbeam-ttn-tracker/commit/ddf47aa1342b1ab8987a4ba11b7c31f1c3e37b12

I had previously used other TTGO devices on a different (non LORA) project and exchanged emails with them about some poor choices they made wrt power rails and sleep. It seems that this new device is much better (but still not perfect).

geeksville commented 4 years ago

Alas, I still haven't received my TBEAM with a screen, so I'll wait to make a clean PR until I can test with that. But I did find a TBEAM without the oled and it seems to work well. Changes compared to your version:

WIP here: https://github.com/geeksville/ttgo-tbeam-ttn-tracker/commits/master

kizniche commented 4 years ago

Very nice work. Have you received your screen yet? I would welcome a PR.

kizniche commented 4 years ago

I tested with the OLED and merged. One thing I tried to add that I couldn't figure out was getting the display to work after sleep. If you have any clue as to how to do this, please share. Thanks.

geeksville commented 4 years ago

alas - I ended up going in a different directly - because TTN coverage seemed a bit spotty where I am. So I made a new project (www.meshtastic.org / https://github.com/meshtastic/Meshtastic-device ) that is LORA but not TTN.

My memory is a bit spotty, but I faced a similar problem getting hte display to work again after sleep on my project. I think the fix was to call this twice:

display->displayOn(); display->displayOn();

Because sometimes the first i2c transaction after wake gets corrupted (presumably because the device doesn't recognize hte START frame)

kizniche commented 4 years ago

I happened to have tried meshtastic for the first time with my 07 and 10 T-Beams a few days ago. I didn't realize you were the creator. Great job with the software and app. And thanks for the display suggestion. I'll give that a try.

FabTangi commented 4 years ago

Hello, display->displayOn(); display->displayOn(); does not work on my TBeam V1.0. Screen remains off after deep-sleep...

geeksville commented 4 years ago

alas ;-)

JMyrng commented 3 years ago

Sorry for asking a question so late in this old issue, but is the LoRa chip and the GPS powered off during deep sleep like mentioned in the second post of @geeksville ?

I´m using version 1.2.1 with a send interval of 60 seconds and deep sleep.

The average current when powered on is 150 mA. In "deep sleep" mode the current is lowered to an average of 65 mA. I am assuming that the LoRa chip is still on and I´m pretty sure that the GPS chip is on all the time too (PPS led is blinking). image