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

    pybytes wifi connection issue

    Scheduled Pinned Locked Moved Support & Troubleshooting
    5 Posts 2 Posters 503 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
      robi90
      last edited by

      Hello,

      I'm trying to get the pybytes firmware running with either our company test wifi or my LTE routers wifi. But I have problems with mqtt packets send by the pybytes module. Atleast on some networks. For example: If I open an hotspot from my smartphone, my lopy connects to pybytes platform no problem. But none of my other networks seem to work. On both internet and DNS seem to work fine.

      I'm running pybytes Firmware version 1.18.2.r6.

      When I build a wlan connection like that:

      from network import WLAN
      wlan = WLAN()
      wlan.init(mode=WLAN.S)
      wlan.init(mode=WLAN.STA)
      wlan.ifconfig(config='dhcp')
      wlan.connect('fitlet-subu', auth=(WLAN.WPA2, '...'))
      print(wlan.ifconfig())
      # output ('10.42.0.135', '255.255.255.0', '10.42.0.1', '10.42.0.1')
      

      It works like expected. But when I try to connect the pybytes firmware (either with pybytes_autostart set on True or manully by calling pybytes.connect_wlan() ) I only get this Error (pybytes_debug set to 6):
      Unknown error while connecting to MQTT server [Errno 113] EHOSTUNREACH

      {'wifi': {'ssid': 'fitlet-subu', 'password': ''}, 'pybytes_autostart': False, 'username': '[...]', 'server': 'mqtt.pybytes.pycom.io', 'cfg_msg': 'Pybytes configuration read from /flash/pybytes_config.json', 'ssl': False, 'device_id': '[...]', 'network_preferences': ['wifi'], 'dump_ca': False, 'wlan_antenna': 0, 'ota_server': {'port': 443, 'domain': 'software.pycom.io'}}
      

      [censored some values with [...] ]

      I have full controll over the network in my LTE router, is there some wifi config needed, that I might have forgotten?

      Also I couldn't find a documentation for the pybytes module. Is there something that explains the methodes and there arguments (like pybytes.send_custom_message() ).

      Thanks in advance.

      Robert

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

        Ok sorry, It's been dealt with. I found the problem already. Our firewall was blocking requests going out and I connected the LTE router to our network to save bandwidth.

        After opening the outgoing firewall ports it works. Whoops.

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

          @robi90 said in pybytes wifi connection issue:

          Also I couldn't find a documentation for the pybytes module. Is there something that explains the methodes and there arguments (like pybytes.send_custom_message() ).

          Thanks in advance.

          Robert

          Although I'm still wondering, if there is a documentation for pybytes functions.

          1 Reply Last reply Reply Quote 0
          • J Offline
            jirkakrepl
            last edited by

            Hi @robi90

            that's good that you resolved your problems. At this time we recommend just to use pybytes.send_signal method for sending data to Pybytes.

            Currently, we haven't documented pybytes-library yet. But it's opensource, so you can take a look at the other functions: https://github.com/pycom/pycom-micropython-sigfox/blob/pybytes-master/esp32/frozen/Base/_pybytes.py

            The whole library is in the Base folder:
            https://github.com/pycom/pycom-micropython-sigfox/tree/pybytes-master/esp32/frozen/Base

            software developer @ Pycom

            Have you checked out our docs for the answer? (Now with an easy search function) https://docs.pycom.io

            Check out our newly revamped device management platform, Pybytes! https://pybytes.pycom.io/

            R 1 Reply Last reply Reply Quote 1
            • R Offline
              robi90 @jirkakrepl
              last edited by

              @jirkakrepl Thanks for the info.

              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