-
Notifications
You must be signed in to change notification settings - Fork 166
Tbeamv1 support #387
base: Dev
Are you sure you want to change the base?
Tbeamv1 support #387
Conversation
Detailed the support of other similar boards.
On T-Beam V1 IO21 is pulled up to 3v3 causing MicroPython to safe boot.
6376ea4
to
601454a
Compare
Dear Nuno, thanks for your contribution! We already picked this up at [1] and included your new target into our list of Squirrel firmware image builds [2] the other day. So, anyone reading here not looking into building their own images might be happy to reach out to TBEAMv1-1.20.2.rc3-0.8.0-vanilla-squirrel.tar.gz. With kind regards, [1] https://community.hiveeyes.org/t/ttgo-t-beam/1848/4 |
Thank you Andreas, glad the contribution helps Squirrel firmware! |
Likewise. We hope the ready-made builds are helping the community. We just went down the rabbit hole of firmware building [1] and found it reasonable to pick up your contribution. For ourselves, we don't use the T-Beam yet but recently started unlocking the T-Call for MicroPython [2,3,4] based on @sarusso's SIM800L.py. You might also be interested in that. [1] https://packages.hiveeyes.org/hiveeyes/foss/pycom/ |
Dear @nunomcruz, thank you so much for your work! I have tested your firmware in a TBEAMv1 and it is working (I have tested ABP example from pycom). In addition, I am trying to get that firmware working in another board TTGO LoRa32 V2.1 (and other variants). I am getting this error after flashing the firmware.
I guess that I need to perform some changes to the current fork but I am pretty new in the inner workings of micropython and I was wondering if you could help or guide me in order to change it for make it work. |
You could try that firmware: https://github.com/robert-hh/Shared-Stuff/blob/master/HELTEC-WSLite-1.20.2.rc11.tar.gz Edit: @nunomcruz. You invested quite a bit of work in your port and that is well done. But you should not be surprised that Pycom has absolutely no interest in supporting other vendor's hardware, for various and good reasons. So don't expect your PR to be accepted. Bug fixes and improvements for the benefit of the Pycom product range are better recognized. |
@robert-hh Thank you so much for your advice! I have just tested it and micropython works well but I have tested the ABP example from pycom and I got another error [Errno 11] EAGAIN when it tries to send a message. I will research what it is happening. In any case, thank you so much for your quick answer 👍 |
I tested that on my heltec board and it worked. However there may be a difference in the LoRa section of the hardware. I could not find schematics of the TTGO Lora V2.1 board to be sure. I took some time to get the firmware running on the heltec device because I had not schematics of the Pycom unit of comparison. In the end if was the difference between the SX1276 clock supply, XTAL vs. XTCO. Just 1 bit in the configuration. I could prepare an image with XTCO setting for trial. |
Created: https://github.com/robert-hh/Shared-Stuff/blob/master/TTGO2-1-1.20.2.rc11.tar.gz |
@elloza Probably the main issue as @robert-hh already mentioned you need to adjust the pinouts, I can't remember all of them but at the time the main issues after adjusting pinouts was because of the SX1276 using the internal clock vs external, the same @robert-hh already mentioned. @robert-hh I understand the PR won't probably be accepted, but at least there's some discussion here about how to port the firmware to other platforms :) |
About pinouts: Yes, I forgot, there is more than reset, like all the interrupt pins. |
@robert-hh thank you so much for your help. I have tried your firmware and I got the same error "[Errn 11] EAGAIN". I have also added a 1k ressistor between 3.3v but I haven't had any luck. I think I have found the schematics here: https://github.com/LilyGO/TTGO-LORA32/blob/master/schematic1in6.pdf LED: IO25 I am reading the source code of @nunomcruz in order to learn how it works, but it seems that i need more background in custom builds in mycropython and to read more!. Thank you for your time! |
@robert-hh, today I have received an Heltec WS (OlED version) and I have tested your last build HELTEC-WS-1.20.2.rc11.tar.gz and I am getting the same error when I test the ABP LoRa example. I dont know if any wiring is required or if I am doing something wrong :( |
I have tested the Heltec WS package here and it worked fine. Edit: Here is my abp_node.py test script used on the Heltec WS. It is a little bit unstructured with some commented code lines, but it works. You have to adapt the setting for device ID and keys.
And here is the config.py. Sometime I test other regions and frequencies, as you see:
|
I'm sorry, it was my fault, With your code it seems that there is no Errrn 11 anymore. Now, in the new firmware for TTGO v2 I'm not getting that error neither. However, I am not able to receive any packet from these devices (Wireless Stick and TTGOv2) on TTN. I have checked your source code with TBEAMv1 and @nunomcruz firmware and it is working like a charm. I don't know why with TBEAM i am able to reach the gateway (uplink and downlink) but with TTGOv2 and WS i'm not receiving anything... Anyway, thank you so much for your help! I'm very close to get it working because your support :D 👍 |
I assume that you registered these devices at TTN. |
Yes, it is the same source code (the code that you have posted above but with my credentials) for all devices. I only get it working with TBeamv1 and @nunomcruz firmware. With your firmware and your code I dont get any OSError but I dont receive any message in TTN console. I'm using Heltec Wireless Stick V2.1 --> https://www.thethingsnetwork.org/forum/uploads/default/original/3X/7/9/79b506ab17f07ebd1c1cf6f511bc216a6c357c67.jpeg |
That's strange. At least the Heltec WS should work, because I tested that with my Heltec device. And, sorry for asking the obvious, did you connect the antennas? |
You are right asking me for the obvious, sometimes I fail with most basic :) . I have double check, antenna and the options in the TTN, I have disabled frame counters checks, I have set 16 bit frame counter width and my keys are in MSB. However I got the same result... It sounds strange for me too. That code works perfectly in the other board. I'm getting an RSSI of -115 and maybe the gateway is too far away...I don't know, becuase it is almost the same hardware... Something that I have noticed it is that when I test the PYCOM ABP example, I get the OSErrn if I use this lines of code:
If you think that I can check something or if you need more info, please let me know it :) Thank you so much @robert-hh ! |
I'll see if I can get one of them! I will also test the two boards with a simple "hello world" in Arduino to exclude any hardware failure. thank you for your help @robert-hh 👍 |
I have tested TTGOv2 with an Arduino example and it works. However, I have tested WS with a simple example from here: https://github.com/rgot-org/TheThingsNetwork_esp32 but I have not had any luck...I am not receiving anything on TTN console. So it seems to be a hardware issue...I will try the SDR and I will check if the antenna is transmitting something... :( |
If you go for the SDR receiver, you could also consider inverting another 10 € for one of these little logic analyzers. Very helpful in testing digital communication: |
Thank you @robert-hh for your advice! 👍 I'm learning how to use the SDR but I think that these signals are what I am looking for. I have checked my WS and it seems to have some problem with the antenna because the signal seems too weak compared with previous one. Finally, I have returned the WS.... The TTGOv2 with your last firmware does not crash but it does not send the packet. I have checked it with an Arduino hello world code and it is working correctly. Thank you for your help! |
That looks good. Needles to say that the SDR is also a good radio receiver, with the audio decoders in the decoding section. |
Thank you @robert-hh! I feel like I'm making you work a lot, I'm sorry! I have tried both firmwares and neither gives me any error but I don't see any signal on the SDR either. I have tested the same device with a Arduino code and I am receiving the data in TTN and seeing the signal in the SDR. I'm kind of at a dead end. Is there anything I can do to debug this? Is there a repository I can start from? Thank you very much for everything! |
Can you give a link to that hardcode? Maybe I see a difference. |
Sorry, it was the spell checker, I meant "Arduino source code". |
What's the link? |
Maybe we could go another way. What I had to change for the ESP32 Pico D4 were
|
Do you mean the Arduino Source code Example? I was trying this repo for knowing if the board was working or not--> https://github.com/rwanrooy/TTGO-PAXCOUNTER-LoRa32-V2.1-TTN |
Slowly I recall all the changes I made for the Heltec board. That is hard to blindly re-do for the TTGO board without testing. So I stop my attempt. |
Don't worry, you've already helped me a lot @robert-hh . I will try to start from @nunomcruz source code to try to adapt it to the TTGOv2. Thank yo so much! |
@robert-hh do you have published the source code for this release? --> https://github.com/robert-hh/Shared-Stuff/blob/master/TTGO2-1-1.20.2.rc11.tar.gz Maybe I could start from that point, at least with your release I am able to run micropython :) ! Thank you so much! |
The base for that was the heltec branch: https://github.com/robert-hh/pycom-micropython-sigfox/tree/heltec
|
I made that changes and I'm getting this error:
:( I will keep trying |
The Pycom port has no clean handling of SPIRAM and flash size. It assumes for Rev 1 CPUs 4 MB of SPIRAM and 8 MByte flash. You can fool that by changing the function esp32_get_chip_rev() in util/espchipinfo.c to return 0.Thats not elegant, but may work. I did more work around that in my port. Sometimes they also access the chipinfo structure. P.S.: The message "GC pool malloc failed!" means progress, because that comes from the pycom firmware, meaning that it started fine. |
Hello again @robert-hh! I have started to try from your heltec branch and I'm facing to an issue that maybe for you it's trivial but for a complete noob like me it's difficult to solve. I'm able to build your firmware and then flash it with:
I don't know if I am missing something at flashing stage or what it's happening... In addition, due to my lack of background it is hard for me debugging this... :( Thank you for your time! |
You have to write: |
Don't forget to call |
Thank you very much @robert-hh. Now it is working properly and I have changed the pins as you told me. I would like to delimit the error. I have changed esp_log_level_set() in main.c and uncommented some printf() in modlora.c in order to get more info about what it's happening under the hood, but I hadn't luck... Do you recommend me to try something in particular? I feel that I am wasting your time and I probably will give up with this last try. (At least I have learned a lot along the way, thanks) In addition, I have been comparing this pull request with your code and @nunomcruz set a lot of defines along the source code for their BOARD, i don't know if modify your branch in the same way... |
Below is the list of file I have changed for the HELTEC adaption. In those except drivers/sx127x/sx1276/sx1276.c esp32/application.mk Some information is also in the file esp32/modified_files_heltec.txt, where I made some notes about the changes. |
I went through the files and looked for what probably to change:
There is still esp32/boards/HELTEC/pins.csv. But that should be fine. |
I uploaded again two variants (XTAL or TCXO) for trial with the changes I noted in my previous post. |
Nuno Cruz seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Hi,
I added support for the TTGO T-Beam V1 by including a new board type in order to keep compatibility. The change will possibly also support other boards from TTGO, but I didn't test it.
The main driver to this was to use the Pycom integration of LoRaWAN with MicroPython since most of the implementations lack features and Pycom one is the most complete.
The PINs association were not mapped to pinouts at the T-Beam board since they are used along the code for setting things up.