Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Pygate and Fake GPS (part 2)

    Scheduled Pinned Locked Moved Discussion
    4 Posts 2 Posters 53 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      ric2498
      last edited by

      Re: Pygate and Fake GPS

      Hi, I suspect that the problem is more deeper than just adding these lines.... here are my observations:

      1. TCPDUMP records from my others GWs.....

      STATs packet from RAK831 and RAK7249

      E.....@.?..;...G...3......7:.....'....x.{"stat":{"time":"2020-08-24 17:33:33 GMT","lati":45.94744,"long":-73.56501,"alti":68,"rxnb":26,"rxok":26,"rxfw":26,"ackr":100.0,"dwnb":0,"txnb":0}}

      E.....@.?..o...G...3..........o..'....x.{"stat":{"time":"2020-08-24 17:34:03 GMT","lati":45.94749,"long":-73.56503,"alti":69,"rxnb":25,"rxok":25,"rxfw":25,"ackr":100.0,"dwnb":0,"txnb":0}}

      STATs packet from PYGATE
      E....+....:#...J.........|....i.p..I....{"stat":{"time":"2020-08-24 17:34:24 GMT","rxnb":26,"rxok":26,"rxfw":26,"ackr":100.0,"dwnb":0,"txnb":0}}

      has we can see the geolocation fields are not part of the stats packet (latitude, longitude and altitude) into the PYGATE record.
      2. According to the info displayed in the PYGATE console, it use the *** Packet Forwarder for Lora PicoCell Gateway *** codes... and if and I say if this code code came from: "https://github.com/Lora-net/picoGW_packet_forwarder/blob/master/lora_pkt_fwd/src/lora_pkt_fwd.c":

          /* generate a JSON report (will be sent to server by upstream thread) */
          pthread_mutex_lock(&mx_stat_rep);
          snprintf(status_report, STATUS_SIZE, "\"stat\":{\"time\":\"%s\",\"rxnb\":%u,\"rxok\":%u,\"rxfw\":%u,\"ackr\":%.1f,\"dwnb\":%u,\"txnb\":%u}", stat_timestamp, cp_nb_rx_rcv, cp_nb_rx_ok, cp_up_pkt_fwd, 100.0 * up_ack_ratio, cp_dw_dgram_rcv, cp_nb_tx_ok);
          report_ready = true;
          pthread_mutex_unlock(&mx_stat_rep);
      

      the code should be updated to include the gps info into the stats packet, like: "https://github.com/Lora-net/packet_forwarder/blob/master/lora_pkt_fwd/src/lora_pkt_fwd.c"

          /* generate a JSON report (will be sent to server by upstream thread) */
          pthread_mutex_lock(&mx_stat_rep);
          if (((gps_enabled == true) && (coord_ok == true)) || (gps_fake_enable == true)) {
              snprintf(status_report, STATUS_SIZE, "\"stat\":{\"time\":\"%s\",\"lati\":%.5f,\"long\":%.5f,\"alti\":%i,\"rxnb\":%u,\"rxok\":%u,\"rxfw\":%u,\"ackr\":%.1f,\"dwnb\":%u,\"txnb\":%u}", stat_timestamp, cp_gps_coord.lat, cp_gps_coord.lon, cp_gps_coord.alt, cp_nb_rx_rcv, cp_nb_rx_ok, cp_up_pkt_fwd, 100.0 * up_ack_ratio, cp_dw_dgram_rcv, cp_nb_tx_ok);
          } else {
              snprintf(status_report, STATUS_SIZE, "\"stat\":{\"time\":\"%s\",\"rxnb\":%u,\"rxok\":%u,\"rxfw\":%u,\"ackr\":%.1f,\"dwnb\":%u,\"txnb\":%u}", stat_timestamp, cp_nb_rx_rcv, cp_nb_rx_ok, cp_up_pkt_fwd, 100.0 * up_ack_ratio, cp_dw_dgram_rcv, cp_nb_tx_ok);
          }
          report_ready = true;
          pthread_mutex_unlock(&mx_stat_rep);
      

      The result of this problem is in the UPLINK record, the location fields (latitude, longitude, altitude) are all 0.

      Has anyone else experienced this?

      Regards.

      Richard.

      1 Reply Last reply Reply Quote 1
      • G Offline
        Gijs
        last edited by Gijs

        You are correct, I did not notice this in my initial review. This was not included in our initial port of the Pygate source. We will have the sourcecode out very soon, so you should be able to adapt this line yourself. I will take care it ends up in the original source
        Best,
        Gijs

        1 Reply Last reply Reply Quote 0
        • G Offline
          Gijs
          last edited by

          In the meantime, I tested adding this line to the status report, but Im not sure what functionality this adds and Im not able to find it anywhere in the TTN console?

          1 Reply Last reply Reply Quote 0
          • R Offline
            ric2498
            last edited by

            Ok Thank you.

            Richard.

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post

            Pycom on Twitter

            Pycom