DeuxVis / Lora-TTNMapper-T-Beam

TTNMapper on the TTGO T-Beam
GNU General Public License v3.0
111 stars 48 forks source link

TTGO T-Beam Rev 1 is not supported #19

Open EccoB opened 4 years ago

EccoB commented 4 years ago

There is a new board version TTGo T-Beam V1.0 which is not supported by this repository because:

There is a repository from kizniche that adopted to that: https://github.com/kizniche/ttgo-tbeam-ttn-tracker

geert2 commented 4 years ago

I tried to compile the kizniche approach and it needs different verisons of already installed libraries. Arduino picks the "other"ones.

Does not compile, probably my error? :

/Users/geertvansintjan/Documents/Arduino/ttgo-tbeam-ttn-tracker-master/main/ttn.ino: In function 'bool ttn_setup()': ttn:140:57: error: 'os_init_ex' was not declared in this scope return ( 1 == os_init_ex( (const void *) &lmic_pins ) ); ^ /Users/geertvansintjan/Documents/Arduino/ttgo-tbeam-ttn-tracker-master/main/ttn.ino: In function 'void ttn_cnt(unsigned char)': ttn:236:24: error: 'LMIC_setSeqnoUp' was not declared in this scope LMIC_setSeqnoUp(num); ^ Multiple libraries were found for "lmic.h" Used: /Users/geertvansintjan/Documents/Arduino/libraries/IBM_LMIC_framework Not used: /Users/geertvansintjan/Documents/Arduino/libraries/arduino-lmic-master Not used: /Users/geertvansintjan/Documents/Arduino/libraries/MCCI_LoRaWAN_LMIC_library Multiple libraries were found for "TinyGPS++.h" Used: /Users/geertvansintjan/Documents/Arduino/libraries/TinyGPSPlus-1.0.2b Not used: /Users/geertvansintjan/Documents/Arduino/libraries/TinyGPSPlus-master Multiple libraries were found for "Wire.h" Used: /Users/geertvansintjan/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/Wire Multiple libraries were found for "SSD1306Wire.h" Used: /Users/geertvansintjan/Documents/Arduino/libraries/esp8266-oled-ssd1306-master Not used: /Users/geertvansintjan/Documents/Arduino/libraries/ESP32_LoRaWAN-master Multiple libraries were found for "SPI.h" Used: /Users/geertvansintjan/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/SPI exit status 1 'os_init_ex' was not declared in this scope

geert2 commented 4 years ago

Indeed, the rev 1 gives with the other code a consistent "no gps fix"

Perhaps I better just define other pins for the gps?

geert2 commented 4 years ago

so this would mean in gps.h ttgobeam version 0.7 has GPS on 12 and 15, replace for ttgobeam 1.0 with 34 and 12

I note rx and tx are mixed up with both programs

DeuxVis commented 4 years ago

As it happens I have recently ordered one of those recent T-Beam version, so I should be soon(1) able to make my code compatible with it.

(1) for a certain definition of "soon" which remains to be determined. ^_^

geert2 commented 4 years ago

Short update : I have apparently the same 1.0 t-beam, I tried for a while with "true" instead of false when checking the GPS, so I could see code going through to lorawan ttn. I noticed indeed "no gps fix" continuity, also with the fix I mentioned above.

Next step: off line for 10 days.

Geert

noppingen commented 4 years ago

Quick fix for v1.0 (v10) board:

In gps.h change the GPIOs for GPS to the changed ones, 12 & 34:

#define GPS_TX 34
#define GPS_RX 12

In the main .ino file add support for the AXP20X power controller to switch on the voltages: After

#include <esp_sleep.h>

add

#include "axp20x.h"
AXP20X_Class axp;

and initialise / switch on the power controller in setup() right after

Serial.println(F("TTN Mapper"));

by adding:

/* Start power controller */
Wire.begin(21, 22);
Serial.println("Starting AXP192 power controller");
if (!axp.begin(Wire, AXP192_SLAVE_ADDRESS)) {
  Serial.println("AXP192 started");
} else {
  Serial.println("AXP192 failed");
}
axp.setPowerOutPut(AXP192_LDO2, AXP202_ON);  // Lora on T-Beam V1.0
axp.setPowerOutPut(AXP192_LDO3, AXP202_ON);  // Gps on T-Beam V1.0
axp.setPowerOutPut(AXP192_DCDC2, AXP202_ON); 
axp.setPowerOutPut(AXP192_EXTEN, AXP202_ON);
axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON); // OLED on T-Beam v1.0
axp.setDCDC1Voltage(3300);
axp.setChgLEDMode(AXP20X_LED_BLINK_1HZ);
axp.adc1Enable(AXP202_BATT_CUR_ADC1, 1);
DeuxVis commented 4 years ago

Thanks for reporting that will save me some time.

geert2 commented 4 years ago

Dear Nop,

Seems not to work for me, wrong library? What do I do wrong?

Kind regards,

Geert

/Users/geertvansintjan/Documents/Arduino/Lora-TTNMapper-T-Beam/Lora-TTNMapper-T-Beam.ino: In function 'void setup()': Lora-TTNMapper-T-Beam:201:6: error: 'axp' was not declared in this scope if (!axp.begin(Wire, AXP192_SLAVE_ADDRESS)) { Serial.println("AXP192 started"); } else { Serial.println("AXP192 failed"); } axp.setPowerOutPut(AXP192_LDO2, AXP202_ON); // Lora on T-Beam V1.0 axp.setPowerOutPut(AXP192_LDO3, AXP202_ON); // Gps on T-Beam V1.0 axp.setPowerOutPut(AXP192_DCDC2, AXP202_ON); axp.setPowerOutPut(AXP192_EXTEN, AXP202_ON); axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON); // OLED on T-Beam v1.0 axp.setDCDC1Voltage(3300); axp.setChgLEDMode(AXP20X_LED_BLINK_1HZ); axp.adc1Enable(AXP202_BATT_CUR_ADC1, 1); ^ Lora-TTNMapper-T-Beam:201:125: error: 'axp' was not declared in this scope if (!axp.begin(Wire, AXP192_SLAVE_ADDRESS)) { Serial.println("AXP192 started"); } else { Serial.println("AXP192 failed"); } axp.setPowerOutPut(AXP192_LDO2, AXP202_ON); // Lora on T-Beam V1.0 axp.setPowerOutPut(AXP192_LDO3, AXP202_ON); // Gps on T-Beam V1.0 axp.setPowerOutPut(AXP192_DCDC2, AXP202_ON); axp.setPowerOutPut(AXP192_EXTEN, AXP202_ON); axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON); // OLED on T-Beam v1.0 axp.setDCDC1Voltage(3300); axp.setChgLEDMode(AXP20X_LED_BLINK_1HZ); axp.adc1Enable(AXP202_BATT_CUR_ADC1, 1);

                                             ^

Multiple libraries were found for "lmic.h" Used: /Users/geertvansintjan/Documents/Arduino/libraries/IBM_LMIC_framework Not used: /Users/geertvansintjan/Documents/Arduino/libraries/MCCI_LoRaWAN_LMIC_library Not used: /Users/geertvansintjan/Documents/Arduino/libraries/arduino-lmic-master Multiple libraries were found for "TinyGPS++.h" Used: /Users/geertvansintjan/Documents/Arduino/libraries/TinyGPSPlus-1.0.2b Not used: /Users/geertvansintjan/Documents/Arduino/libraries/TinyGPSPlus-master Multiple libraries were found for "WiFi.h" Used: /Users/geertvansintjan/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/WiFi Not used: /Applications/Arduino.app/Contents/Java/libraries/WiFi Multiple libraries were found for "axp20x.h" Used: /Users/geertvansintjan/Documents/Arduino/libraries/AXP202X_Library-master Multiple libraries were found for "Wire.h" Used: /Users/geertvansintjan/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/Wire Multiple libraries were found for "SPI.h" Used: /Users/geertvansintjan/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/SPI exit status 1 'axp' was not declared in this scope

On Wed, Feb 5, 2020 at 10:01 AM DeuxVis notifications@github.com wrote:

Thanks for reporting that will save me some time.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DeuxVis/Lora-TTNMapper-T-Beam/issues/19?email_source=notifications&email_token=AE65HP2UYVWDRABDRYC3KMDRBJ57BA5CNFSM4J3APOTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK2U3LI#issuecomment-582307245, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE65HP7RH55FGTJM3EA4FDTRBJ57BANCNFSM4J3APOTA .

DeuxVis commented 4 years ago

@geert2 it looks like you forgot to add

#include "axp20x.h"
AXP20X_Class axp;

maybe ?

noppingen commented 4 years ago

Posted my updated project on Github:

https://github.com/noppingen/Lora-TTNMapper-T-Beam-v10/

Recycle, reuse, re-fork but triple-check: My code usually is usually not good for running a heart-lung machine...

geert2 commented 4 years ago

It works. There must have been something I did not notice, but it worked all along.

Any hint how to bring my GPS coordinates to my mobile?

excellentplans commented 4 years ago

Just for reference, because I was confused before I tried it out: The current version of the TTNMapper-T-Beam works fine with my T-Beam rev 1! Maybe close the issue?

DeuxVis commented 4 years ago

Looks like it is working for everyone ? Please do reopen if needed.

DeuxVis commented 3 years ago

Reopened because it needs some documentation of the configuration change for the GPS to work on boards V1.0 - different pinout, see https://github.com/Xinyuan-LilyGO/LilyGO-T-Beam#Pinout