• Problem getting MAG data from Adafruit LSM303

    LoPy adafruit lopy magnetometer
    4
    0 Votes
    4 Posts
    737 Views
    O
    @rcolistete Maybe I misunderstood your question. The code I was referring to above is my own library that calls the 'built-in' machine.I2C micropython driver supplied in the LoPy firmware binary rev. 1.18.1.r1. Example: def __init__(self): self.i2c = I2C(0, mode=I2C.MASTER, pins=(sda, scl), baudrate=100000); magEnable = [0x10, 0x20, 0x00] self.i2c.writeto_mem(MAG_DEV_ADDR, MAG_CONFIG_REG_A, bytearray(magEnable));
  • Adafruit connection OSError: -1

    LoPy lopy adafruit oserror -1
    1
    1
    0 Votes
    1 Posts
    480 Views
    No one has replied
  • LoRa-MAC (Raw LoRa)

    LoPy adafruit lopy loramac
    3
    0 Votes
    3 Posts
    908 Views
    V
    @robert-hh Thanks! You saved my day again.
  • MQTT cannot subscribe to adafruit

    LoPy mqtt adafruit subscribe
    3
    0 Votes
    3 Posts
    977 Views
    V
    @seb Hi sorry seb, because the upper part is only wifi configuration so i didnt show it. Here is the whole main.py from network import WLAN from mqtt import MQTTClient import machine import time import pycom #from machine import Pin #pin=Pin('P10',mode=Pin.IN, pull=Pin.PULL_UP) wlan = WLAN(mode=WLAN.STA) wlan.antenna(WLAN.EXT_ANT) wlan.connect("xxx", auth=(WLAN.WPA2, "xxx"), timeout=5000) while not wlan.isconnected(): machine.idle() print("Connected to Wifi\n") def settimeout(duration): pass def sub_cb(topic, msg): print(msg) client = MQTTClient(client_id="xxx", server="io.adafruit.com",user="vickyho", password="xxx", port=1883) client.settimeout=settimeout client.set_callback(sub_cb) client.connect() print("connected to broker\n") client.publish(topic="vickyho/feeds/lights",msg="False") print("Published!") time.sleep(10) client.subscribe(topic="vickyho/feeds/lights") print("Subscribed!") while True: client.check_msg() if client.subscribe(topic="vickyho/feeds/digital",msg="ON") pycom.rgbled(0xff00) print("Led ON") time.sleep(3) if client.subscribe(topic="vickyho/feeds/digital",msg="OFF") pycom.heartbeat(False) pycom.rgbled(0x0000) print("Led OFF") time.sleep(3) thanks for your reply btw!
  • LoRa receiving data intermittently

    LoPy lopy rfm95 adafruit feather arduino
    18
    0 Votes
    18 Posts
    5k Views
    H
    @maelstrom Hello, LoRaRAW works for me between 2 LoPys both on EUR and US frequencies on the latest firmware, all the other parameters are default values.
  • Adafruit: no data displayed in Feed Panel

    LoPy adafruit mqtt lopy
    2
    0 Votes
    2 Posts
    902 Views
    B
    Hi @YazIdo, Could you please share your code so I can see what the issue might be? Thanks, Alex
  • 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")
  • 3 Votes
    2 Posts
    2k Views
    L
    @PiAir Thank you for sharing this
  • ADXL 345 (from Adafruit)

    Discussion adxl345 accelerometer sensor adafruit sensors
    14
    0 Votes
    14 Posts
    4k Views
    D
    @Lokefar Can you post the final working code for this sensor with lopy 4?