Hamlabs / ArcticTracker-ESP32

Arctic Tracker on ESP32
GNU General Public License v3.0
40 stars 4 forks source link

[Feature] the firmware port for LilyGO T-TWR Plus #3

Closed lyusupov closed 7 months ago

lyusupov commented 10 months ago

Thank you for this great project!

Is there any chance to port this APRS firmware for the LilyGO T-TWR Plus ?

This approach can give a lot wider exposure for your firmware since the LilyGO development board is available in large quantities at more or less reasonable price.

The LilyGO board has some hardware items that are very similar to that the ArcticTracker v.3 uses, such as

Please, see the schematic file for more details.

SA868 radio is a little bit different to the FRS one but not a lot, right ?

ohanssen commented 10 months ago

Yes, thanks for a interesting idea. There are many similarities so it is probably not too hard to do it so I'll take a look into it.

ohanssen commented 9 months ago

I've got a T-TWR, I've tested it and it looks good. I tried to load the Arctic Tracker firmware onto it and it runs. The ESP32 module is the same as the AT, so the console, wifi and storage works without modification. The interfacing to the other hardware need to be adapted though :)

ohanssen commented 9 months ago

Status now: Display UI is working. PMU is working (with XPowerLib), battery-status is reported on display, console and REST-API. Charging is ok. GPS is working when it is powered up.

lyusupov commented 9 months ago

@ohanssen

Please, be aware that

  1. effective (approx.) from September, the LilyGO have fixed issue with wrong value of R22 resistor.
    it may still be shown as 4.7K on the schematic file but one should actually read it as 47K instead
image



Inspect that your T-TWR Plus board uses 47K for the R22 value. If it is true - it is recommended to NO longer use 11dB as ADC attenuation here:

image





For recently manufactured boards it is recommended to use 0 dB attenuation value.

Older boards (manufactured before September) can be fixed by the R22 replacement:



Read this thread for more details: https://github.com/erstec/APRS-ESP/discussions/29#discussioncomment-7276102

lyusupov commented 9 months ago
  1. effective from November, the LilyGO is shipping the T-TWR Plus with pre-installed TinyUF2 bootloader:

https://github.com/Xinyuan-LilyGO/T-TWR/blob/master/firmware/README.MD

Both SoftRF and OpenRTX projects are using UF2 format to deploy the firmware for public: 1) https://github.com/lyusupov/SoftRF/blob/master/software/firmware/binaries/README.md#esp32-s3 2) https://openrtx.org/#/hardware/ttwrplus?id=flashing

It is recommended for the Arctic Tracker for T-TWR Plus project to use the UF2 binary format as well.

ohanssen commented 8 months ago

ESP-IDF I guess it is not a big deal to generate the UF2 format.

Sending packets with the SA868 now works. There is one thing though: There seems to be no connection from the squelch output of the radio-module to the ESP32. It was an easy way to detect that a signal was present on the channel. This can still be done by sampling the ADC input from the radio though. I'll be aware of the resistor.

lyusupov commented 8 months ago

Rev 2.0 of the T-TWR Plus does not have the SQL line connected to an ESP32-S3 pin on the PCB. However, since it is a Dev Kit, one can solder a wire to the pin header manually (when necessary).

Upcoming rev 2.1 of the T-TWR Plus has a certain wiring for the SQL of SA868 to the ESP32-S3 pin as one of added new features.

Video of LilyGO T-TWR Plus V2.1: https://twitter.com/lilygo9/status/1752865846727446786 Schematic file: https://github.com/Xinyuan-LilyGO/T-TWR/blob/master/schematic/T-TWR-Plus_Rev2.1.pdf

ohanssen commented 8 months ago

Ok, thanks for the info. I will try putting in a wire. I look forward to the 2.1.

ohanssen commented 7 months ago

I've put ut a release candidate. I have tested with UF2 bootloader but it failed. I hope to be able to make it available in UF2 format when this issue is solved.

lyusupov commented 7 months ago

Øyvind, please, accept my sincere congratulation with completion of the new Release Candidate!

I have tested with UF2 bootloader but it failed. I hope to be able to make it available in UF2 format when this issue is solved.

The instruction below works good to me.

$ uf2conv.py /tmp/ArcticTracker-3.1-rc1.bin -c -f 0xc47e5767 -b 0 -o /tmp/ArcticTracker-3.1-rc1.uf2
Converting to uf2, output size: 2454528, start address: 0x0
Wrote 2454528 bytes to /tmp/ArcticTracker-3.1-rc1.uf2

The UF2 output file boots all the way down to the command prompt with T-TWR 2.0 product.

lyusupov commented 7 months ago

An attempt to connect to a local Wi-Fi AP gives me the system reset:

Welcome to Arctic Tracker 3.1 on ESP32S3, by LA7ECA.

Type 'help' to get the list of commands.
Use UP/DOWN arrows to navigate through command history.
Press TAB when typing command name to auto-complete.
cmd> W (4452) trackstore: Couldn't open file /files/tracks_blk0.bin: No such fiy
W (4452) gptimer: resolution lost, expect 38400, real 38406
W (4452) gptimer: resolution lost, expect 211200, real 211640
cmd>
cmd> wifi on
OK
cmd> wifi-join <MySSID> <MyKEY>
ESP_ERROR_CHECK failed: esp_err_t 0x3002 (ESP_ERR_WIFI_NOT_STARTED) at 0x4200e6e
file: "./components/networking/wifi.c" line 483
func: wifi_join
expression: res

abort() was called at PC 0x4037f9f7 on core 0

Backtrace: 0x4037637e:0x3fca7500 0x4037fa01:0x3fca7520 0x40383fbf:0x3fca7540 0x0

ELF file SHA256: 9e978d11a0d38cbe

Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x3 (RTC_SW_SYS_RST),boot:0x29 (SPI_FAST_FLASH_BOOT)
ohanssen commented 7 months ago

You may try another command:

ap 0 <your-ssid> <your-key>

I'll take a look at the join command. It is some legacy code - probably not needed anymore.

UnderwaterHockey commented 7 months ago

Ok, thanks for the info. I will try putting in a wire. I look forward to the 2.1.

Any way you can add a pic of where that wire goes to the readme?

ohanssen commented 7 months ago

You see one end of the wire in the pic already. The other end is connected to the SQL output of the radio. I plan to publish an article on Hamlabs soon and will put the picture there as well. 20240320_220606

UnderwaterHockey commented 7 months ago

Great, thank you! I was thinking that shield had to come off to add the wire.

lyusupov commented 7 months ago

@ohanssen

Since you've released the firmware for the T-TWR Plus recently - I guess it is a good reason to close this GitHub ticket now.

lyusupov commented 7 months ago

@ohanssen

Øyvind , do you have any objections if LilyGO will add a link onto your project's GitHub page on their Store website, like that -

image
ohanssen commented 7 months ago

Ok, I don't see a problem with that.

lyusupov commented 7 months ago

Ok, I don't see a problem with that.

This page contains a reference on Arctic Tracker project - https://www.lilygo.cc/products/t-twr-plus?variant=42911934185653

image
UnderwaterHockey commented 7 months ago

@ohanssen hamlabs.no seems to have been down for a few days now.