Giter VIP home page Giter VIP logo

ttn_mapper_t-beam's People

Contributors

bitconnector avatar stefanheinrichsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ttn_mapper_t-beam's Issues

Compile issues

Having problems compiling it:

src/lorawan.cpp: In function 'void startup_lorawan()':
src/lorawan.cpp:66:54: error: 'DR_SF12' was not declared in this scope
         LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI);  // g-band
                                                      ^
.pio/libdeps/esp32/MCCI LoRaWAN LMIC library/src/lmic/lmic.h:680:50: note: in definition of macro 'DR_RANGE_MAP'
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                  ^
src/lorawan.cpp:66:72: error: 'BAND_CENTI' was not declared in this scope
         LMIC_setupChannel(0, 868100000, DR_RANGE_MAP(DR_SF12, DR_SF7), BAND_CENTI);  // g-band
                                                                        ^
In file included from .pio/libdeps/esp32/MCCI LoRaWAN LMIC library/src/arduino_lmic.h:26:0,
                 from .pio/libdeps/esp32/MCCI LoRaWAN LMIC library/src/lmic.h:28,
                 from src/lorawan.hpp:5,
                 from src/lorawan.cpp:1:
src/lorawan.cpp:67:63: error: 'DR_SF7B' was not declared in this scope
         LMIC_setupChannel(1, 868300000, DR_RANGE_MAP(DR_SF12, DR_SF7B), BAND_CENTI); // g-band
                                                               ^
.pio/libdeps/esp32/MCCI LoRaWAN LMIC library/src/lmic/lmic.h:680:79: note: in definition of macro 'DR_RANGE_MAP'
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                                               ^
src/lorawan.cpp:74:54: error: 'DR_FSK' was not declared in this scope
         LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK, DR_FSK), BAND_MILLI);   // g2-band
                                                      ^
.pio/libdeps/esp32/MCCI LoRaWAN LMIC library/src/lmic/lmic.h:680:50: note: in definition of macro 'DR_RANGE_MAP'
 #define DR_RANGE_MAP(drlo,drhi) (((u2_t)0xFFFF<<(drlo)) & ((u2_t)0xFFFF>>(15-(drhi))))
                                                  ^
src/lorawan.cpp:74:71: error: 'BAND_MILLI' was not declared in this scope
         LMIC_setupChannel(8, 868800000, DR_RANGE_MAP(DR_FSK, DR_FSK), BAND_MILLI);   // g2-band
                                                                       ^
Compiling .pio/build/esp32/lib200/MCCI LoRaWAN LMIC library/lmic/lmic_compliance.c.o
Compiling .pio/build/esp32/lib200/MCCI LoRaWAN LMIC library/lmic/lmic_eu868.c.o
Compiling .pio/build/esp32/lib200/MCCI LoRaWAN LMIC library/lmic/lmic_eu_like.c.o
In file included from src/gps.hpp:5:0,
                 from src/main.cpp:8:
src/locations.h:10:17: warning: 'geofence' defined but not used [-Wunused-variable]
 static Geofence geofence[] = {
                 ^
*** [.pio/build/esp32/src/lorawan.cpp.o] Error 1

Geofence clarification

Hi, first of all, thanks a lot for sharing this version of ttn_mapper for the tbeam. I am currently playing around with it and i do see join/accept traffic in the TTN console:

08:05:13 Forward join-accept to Application Server
08:05:13 Forward join-accept message
08:05:13 Receive join-accept message
08:05:13 Successfully scheduled join-accept for transmission on Gateway Server
08:05:13 Schedule join-accept for transmission on Gateway Server Rx1 Delay 5

however, I see no actual payload data. I didnt change anything regarding geofencing so far, so my question is:

How is geofencing supposed to work, i.e. only send data while within geofence or send data only when out of the fenced area? Would that explain why I dont see any payload data yet?

Cannot seem to get a GPS fix

Hi Lukas - great approach to the firmware. I really like the minimalistic approach and can't wait getting it to work so I can extend it with my personal use-cases (will fork and add them then..)

After struggling the whole day with getting the join to work with TTN I updated the TTN settings as read in bitconnector/LittleWan#1 to "Frequency plan Europe 863-870 MHz (SF9 for RX2 - recommended),
LoRaWAN version MAC V1.0.4 and Regional Parameters version PHY V1.0". This gave me the long awaited success on the join...

Now I have it running and connected but the GPS does not seem to get a fix. I have the T-Beam v1.2 with the AXP2101 chip and I am somehow suspecting it to not power the GPS appropriately... Here is the log of board including axp_print().

Any suggestions what to try? I tried taking the timeout out of the gps_loop() while loop but that also gave nothing...
Will leave it for the night now and see what the status in the morning is..

Best, Arne

rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13232
load:0x40080400,len:3028
entry 0x400805e4
AXP2101 PMU init succeeded
isCharging:YES
isDischarge:NO
isVbusIn:YES
getBattVoltage:4198mV
getVbusVoltage:5156mV
getSystemVoltage:5136mV
getBatteryPercent:100%

=========================================
DC1  : +   Voltage: 3300 mV 
DC2  : -   Voltage: 0900 mV 
DC3  : -   Voltage: 0900 mV 
DC4  : -   Voltage: 1100 mV 
DC5  : -   Voltage: 1200 mV 
ALDO1: -   Voltage: 1800 mV 
ALDO2: +   Voltage: 3300 mV 
ALDO3: +   Voltage: 3000 mV 
ALDO4: -   Voltage: 2900 mV 
BLDO1: -   Voltage: 1800 mV 
BLDO2: -   Voltage: 2800 mV 
=========================================
4198
Wakeup caused by timer
GPS-loop
$GPRMC,170929.00,V,,,,,,,191123,,,N*70
$GPVTG,,,,,,,,,N*30
$GPGGA,170929.00,,,,,0,00,99.99,,,,,,*62
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,00*79
$GPGLL,,,,,170929.00,V,N*4E
GPS-end: no fix

no gps fix

got this installed on my lilygo t beam (the 1.2 varient with the 2101 power chip)
however I can't seem to get a gps fix

{
  "name": "as.up.data.forward",
  "time": "2024-03-18T13:01:26.872332427Z",
  "identifiers": [
    {
      "device_ids": {
        "device_id": "REDACTED",
        "application_ids": {
          "application_id": "REDACTED"
        },
        "dev_eui": "REDACTED",
        "join_eui": "REDACTED",
        "dev_addr": "REDACTED"
      }
    }
  ],
  "data": {
    "@type": "type.googleapis.com/ttn.lorawan.v3.ApplicationUp",
    "end_device_ids": {
      "device_id": "REDACTED",
      "application_ids": {
        "application_id": "REDACTED"
      },
      "dev_eui": "REDACTED",
      "join_eui": "REDACTED",
      "dev_addr": "REDACTED"
    },
    "correlation_ids": [
      "gs:uplink:REDACTED"
    ],
    "received_at": "2024-03-18T13:01:26.869019789Z",
    "uplink_message": {
      "session_key_id": "AY5RpvhBCFsBPJhNRm3Mdg==",
      "f_port": 1,
      "f_cnt": 1,
      "frm_payload": "QAIA",
      "decoded_payload": {
        "bat": 3.14,
        "gps": 0,
        "msg": "status: startup\nGPS: no fix\nbat: -34% 3.14V",
        "percentage": -34,
        "status": 2
      },
      "rx_metadata": [
        {
          "gateway_ids": {
            "gateway_id": "eui-afdcbacf1250e868",
            "eui": "AFDCBACF1250E868"
          },
          "timestamp": 3486013557,
          "rssi": -62,
          "channel_rssi": -62,
          "snr": 12.2,
          "frequency_offset": "3619",
          "uplink_token": REDACTED,
          "received_at": "2024-03-18T13:01:26.658027940Z"
        }
      ],
      "settings": {
        "data_rate": {
          "lora": {
            "bandwidth": 125000,
            "spreading_factor": 10,
            "coding_rate": "4/5"
          }
        },
        "frequency": "868100000",
        "timestamp": 3486013557
      },
      "received_at": "2024-03-18T13:01:26.665481628Z",
      "consumed_airtime": "0.329728s",
      "network_ids": {
        "net_id": "000013",
        "ns_id": "EC656E0000000181",
        "tenant_id": "ttn",
        "cluster_id": "eu1",
        "cluster_address": "eu1.cloud.thethings.network"
      }
    }
  },
  "correlation_ids": [
    "gs:uplink:REDACTED"
  ],
  "origin": "ip-10-100-12-78.eu-west-1.compute.internal",
  "context": {
    "tenant-id": "CgN0dG4="
  },
  "visibility": {
    "rights": [
      "RIGHT_APPLICATION_TRAFFIC_READ"
    ]
  },
  "unique_id": "REDACTED"``` 

How to declare the end device in TTS console ?

Hi

Thanks for your repo as I plan to use your code for my T-Beam and complete TTNMapper around my area and test also coverage of my own gateway.
How do you declare the T-Beam in End-device creation page in TTS ? Lilygo for sure is not liste, I could find Espressif but it lists only ESPEasy fw and if I go manually it asks a lot of technical details I have no clue what are correct settings for T-Beam :(

Thanks

Vincèn

Display not working

Hi,
thanks for this great project! Very much appreciated!

I'm using a TTGO T-Beam 1.2 with a SSD1306 display.
I just have the issue that the display output is not working for me and I can't figure out how to solve it.
I use your code as is in platform.io and just edited the credentials.
Everything else is working fine.

It would be great if you could help me.
Thanks in advance!

changes for old v1.0 TTGO-T-Beam

I cloned the repository to find out what have to be changed in order to be able to use this code for TTGO-T-Beam v1.0
I found already the GPS pins, but what give me headaches is how to remove the AXP deep sleep. Can you please give me some hints where it is sitting and what have to be removed.
I am also wondering how to disable geofencing. btw. I always get a warning of the compiled that the variable geofencing is not used. But I have not changed the location.h file.

US 915 frequencies?

How can I use this code for US LoRa frequencies?

I see a list of freq in lorawan.cpp that are for another region.

Thanks

OOTA vs. ABP

Just wanted to ask if there is any special reason for using ABP and not OOTA as activation method?

No display working !

Hi

I downloaded your code, updated credentials, compiled it successfully in VSCode with Platform.io extension and upload it in my T-Beam and since the display is off (nothing displayed at all even pushing on buttons is doing nothing :(
I have same T-Beam as you according at engravings on it no ?
IMG_20210927_140915
How can I find out issue here ? I kept VSCode connected at Tbeam during reboot but no log shows up on the USB port :(

Thanks

Vincèn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.