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

    Set Pin high through LoRa

    Scheduled Pinned Locked Moved LoPy
    gpiolopylorahighlow
    9 Posts 3 Posters 2.3k Views 3 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.
    • J Offline
      JFS
      last edited by

      Dear all,

      is there an easy way to set an output pin on the LoPy high/low remotely using LoRa? As far as I was told you can only receive a downlink after successful uplink transmission, which would mean that it is not feasible. But after reading the description of class C devices I am not sure anymore.

      Can anyone help me with this one? Thanks in advance!

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jmarcelino @JFS
        last edited by

        @jfs

        In LoRaWAN if you're using Class C you can receive at any time, but not many (public) networks support it also it's more power hungry because the radio

        You can however use raw LoRa if you're just trying to do it point to point (e.g. from LoPy to LoPy)

        1 Reply Last reply Reply Quote 1
        • J Offline
          JFS
          last edited by JFS

          @jmarcelino
          Thank you very much for your quick reply! I am quite new to LoRa so I would like to ask you another question. Using two LoPy would be a good enough solution for me. Can I use: https://docs.pycom.io/chapter/tutorials/lopy/lopy-lopy.html to send
          p_out.value(1) or
          p_out.value(0)
          from one to the other device instead of the "ping" and "pong" from the example.

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jmarcelino @JFS
            last edited by jmarcelino

            @jfs
            Yes just send a value that the other side then interprets as turning on or off.

            Maybe the latest hackster LoRa example from @seb can also help as it uses LoRa to communicate and send the colour of the LED to set:

            https://www.hackster.io/user83346052/lora-sensor-network-for-detecting-a-robot-1ae1f9

            J C 2 Replies Last reply Reply Quote 2
            • J Offline
              JFS @jmarcelino
              last edited by

              @jmarcelino
              thanks a lot!

              1 Reply Last reply Reply Quote 0
              • C Offline
                crumble @jmarcelino
                last edited by

                @jmarcelino said in Set Pin high through LoRa:

                @jfs
                Yes just send a value that the other side then interprets as turning on or off.

                But this can be really dangerous. You will receive any LoRa message of your surrounding. Opening a door if the first byte is 0x01 may not be very smart ;) You have to find an envelope to distinguish your messages from others.

                J 1 Reply Last reply Reply Quote 0
                • J Offline
                  jmarcelino @crumble
                  last edited by

                  @crumble
                  Good point, thanks! Yes adding an identifier sequence of bytes is a good idea.

                  Also if you want any security you'll need to do some encryption (and change keys to avoid replay attacks), raw LoRA unlike LoRaWAN does not do this.

                  J 1 Reply Last reply Reply Quote 0
                  • J Offline
                    JFS @jmarcelino
                    last edited by

                    @jmarcelino @crumble
                    Thank you both for your answers. I understand that I would need a time-constrained and changing access key for a proper application, but first I would like to run some simple tests. So would be enough to hardcode an access key and test it like for example here:

                    while True:
                    if s.recv(64) == b'HARDCODEDKEY123456789':
                    p_out.value(1)
                    time.sleep(5)

                    C 1 Reply Last reply Reply Quote 0
                    • C Offline
                      crumble @JFS
                      last edited by

                      @jfs yes, shall be OK. Simply give it a try.

                      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