• mqtt message directed to switc-case issue

    Discussion python mqtt
    3
    0 Votes
    3 Posts
    872 Views
    M
    its working now, not sure why, maybe the file were out of sync
  • GPy and LTE

    Getting Started gpy lte mqtt internet
    38
    0 Votes
    38 Posts
    14k Views
    N
    @jmarcelino Done ;)
  • Check if mqtt is conncted?

    Discussion mqtt
    2
    0 Votes
    2 Posts
    822 Views
    L
    @misterlisty put send code in try block, if it raise an error, then there is possibility that server is not available or you are not connected to the network at all
  • simple mqtt client not working

    LoPy mqtt lopy
    6
    0 Votes
    6 Posts
    2k Views
    H
    @st3vev thx so much. This should really be mentioned in the tutorial. I also think that this polling needs to be activated automatically once a subscribe happens.
  • mqtt lib subscribe blocking

    Getting Started lopy mqtt
    1
    1 Votes
    1 Posts
    751 Views
    No one has replied
  • 0 Votes
    2 Posts
    2k Views
    robert-hhR
    @sesamproductions You have to copy the mqtt code to your device first. Instructuctions are for instance here: https://docs.pycom.io/chapter/tutorials/all/aws.html, or search the forum for mqtt. Edit: A simple mqtt client is also available at the micropython lib https://github.com/micropython/micropython-lib
  • MQTT with 2 subscribes

    MicroPython mqtt
    16
    0 Votes
    16 Posts
    4k Views
    L
    @luc-hanneuse first you can try to test if it is None if v==None: and also you can test for type by: type(v)
  • 0 Votes
    6 Posts
    2k Views
    T
    Arghh. Got it. It was a typo in the config file of my broker. The broker was running on the wrong port. Thanks. Thomas
  • Kernel Panic when using SSL connections (MQTT or HTTPS)

    LoPy ssl mqtt https
    6
    0 Votes
    6 Posts
    2k Views
    T
    @aktivalux said in Kernel Panic when using SSL connections (MQTT or HTTPS): -35123 You mean it raises OSError: -35123? Actually -35123 beeing -0x8933 is out of the error range defined by mbedtls. Is there a typo in this numer? https://tls.mbed.org/api/error_8h.html
  • Wifi RSSI and mqtt subscribe

    MicroPython micropython mqtt wifi rssi rgb
    3
    0 Votes
    3 Posts
    2k Views
    S
    @this.wiederkehr Thanks, I will try that later tonight.
  • 0 Votes
    6 Posts
    2k Views
    S
    @ledbelly2142 Not yet, I did read somewhere here that the battery voltage is connected to ADC pin 16 so it should be possible. Hoping for an example that can report it as a Battery percentage. I'd like to have the following Topic structure on my LoPy's MQTT topic: lopy/ip lopy/probes/1 ... lopy/probes/4 lopy/battery lopy/rgb lopy/oled/1 ... lopy/oled/4 lopy/ble Cant think of any more yet. Still not sure how i'll go with my plan of 4x SPI Type K temp probes and 4x 128x32 OLEDs as they are SPI as well and require more than just a CS per screen. Reporting on the Battery topic would be things like percentage when it hits internal warning levels.. but with the view to using deep sleep it would probably report on wake up. Also a notification when its charging if at all possible would be nice. I changed the IP topic and paylod to this btw client.publish(topic="lopy/ip", msg=wifiaddress) And on the far end I use Node-red to append to the front: "LoPy Booted with IP: " + msg.payload; *node red function code - not micropython And send the string to Pushover for a push notification on my phone. I've also mapped the on board button to do a machine.reset() so I can carry it around, hit reset then get a notification on my phone if it connects to WiFi (good for range testing).
  • Adafruit: no data displayed in Feed Panel

    LoPy adafruit mqtt lopy
    2
    0 Votes
    2 Posts
    926 Views
    B
    Hi @YazIdo, Could you please share your code so I can see what the issue might be? Thanks, Alex
  • AWS MQTT - syntax error on test code

    WiPy 2&3 wipy2.0 mqtt
    1
    0 Votes
    1 Posts
    819 Views
    No one has replied
  • OSError: -1

    LoPy adafruit mqtt lopy
    6
    0 Votes
    6 Posts
    2k Views
    L
    @yazido Do not use "keepalive" in function MQTTClient. Examle: c = MQTTClient("ESPython", "192.168.0.21", port=1883, user="user", password="pass", keepalive=0) or c = MQTTClient("ESPython", "192.168.0.21", port=1883, user="user", password="pass")
  • WiPy - MQTT - Azure IoT Hub

    WiPy 2&3 wipy mqtt azure
    2
    0 Votes
    2 Posts
    2k Views
    B
    Hi @jancb, please try the example on our GitHub repo - https://github.com/pycom/pycom-libraries/tree/master/examples/mqtt - I need to update the docs as they are out of date! Thanks!
  • 0 Votes
    5 Posts
    3k Views
    ledbelly2142L
    Thanks @ahaw021 I am still wrapping my mind around how to go from sensor/MQTT-->LoPy send via LoRa to a LoPy acting as a RAW LoRa Nano-Gateway/LoPy--> that then forwards the message over wifi on local network. LoPy/LoRa Node --> LoPy/LoRa NanoGateway (recieves and forwards via WiFi)-->LoPy/WiFi NanoGateway --> local network. I apologize that I have not been very clear in my posts. In the LoPy NanoGateway discussion "The nodes send messages to the Nano-Gateway for further processing, this might include sending the messages over WiFi to a server for example." I want to forward messages over WiFi. The MQTT example HERE uses WiFi to send client messages to the MQTT Broker. Each LoRa/LoPy node needs to send the data to the NanoGateway, the NanoGateway needs to send it to the MQTT Broker. I don't know if there is a simple programmatic way to assemble and send the messages/topics from the NanoGateway to the MQTT Broker. Ideally it would just publish topics/data based on the message payload from the LoPy node. However, this hard codes publishing topics in node code. In the LoPy RAW NanoGateway example HERE the node code the message payload (Sensor Data Here) could include sensor data that the NanoGateway would publish the topic to the MQTT broker. msg = "Sensor Data Here" pkg = struct.pack(_LORA_PKG_FORMAT % len(msg), DEVICE_ID, len(msg), msg) lora_sock.send(pkg) It seems like this would work, but I would like the message payload to be inclusive like msg = "client.publish("/sensors/sensor8/print(temp)")" pkg = struct.pack(_LORA_PKG_FORMAT % len(msg), DEVICE_ID, len(msg), msg) lora_sock.send(pkg) I am not sure of a proper syntax to send in the message payload for parsing and forwarding. Perhaps just the topic e.g. /sensors/sensor8/temp, print(temp) The NanoGateway would receive the message payload and publish the topic with something like: client.publish("/sensors/sensor8/temp", "72.3") This would hard code each LoRa/LoPy sensor node with its topics, which is not very flexible. And I think this is just on way, not sure how to forward a node subscribing back via LoRa from the NanoGateway. Has anyone done anything like this? Any feedback is appreciated.
  • Failed to connect Lopy with AWS and MQTT.

    LoPy lopy mqtt aws amazon iot
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Node-Red

    Projects mqtt
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Using MQTT with SSL on Lopy

    LoPy mqtt ssl
    4
    0 Votes
    4 Posts
    2k Views
    G
    @sakis said in Using MQTT with SSL on Lopy: ssl_params is a dict. You shouldn't use = to assign values to dict keys, but : Also, a key should be a valid Python type (in this case str I guess): ssl_params= {'cert_reqs':ssl.CERT_REQUIRED, 'ca_certs':'pycom/ca.pem'} https://docs.python.org/3/tutorial/datastructures.html#dictionaries More on...Python dictionary
  • 0 Votes
    5 Posts
    2k Views
    R
    @mkbenon You're welcome, I just gave you some hints, glad that you manage yourself (best learning method). :o) Also please note that MQTT example script changes WLAN antenna mode for external (WLAN.EXT_ANT). If your LoPy setup has the external antenna - that's OK, but if not you should use default internal antenna (WLAN.INT_ANT).