LoPy and MicroPython

Cross-Reference blog.bachi.net:
Internet of Things (IoT) Protocols & Standards
LoRa: The Things Network

kickstarter: LoPy – the LoRa, WiFi and Bluetooth IoT development platform, 8. Feb 2016 – 8. Mar 2016 (30 Tage)
Pycom

kickstarter: Micro Python: Python for microcontrollers, 13. Nov 2013 – 13. Dez 2013 (30 Tage)
MicroPython – Python for microcontrollers
github: MicroPython – a lean and efficient Python implementation for microcontrollers and constrained systems

PyCom Announcements & News, (Update Firmware, etc.)

Documentation

Pycom ESP32
Pycom LoPy: WLAN (old?)
Pycom LoPy: Quick reference for the LoPy (old?)
class LoRa (old?)
Python Module: Modularisierung
Python Tutorial: Module

FTDI Drivers

D2XX Drivers

Support Download

github.com/pycom
github.com/pycom/pycom-libraries/examples/
Support Download

Forum Posts

iC880 A SPI : Missing Payload in received Packet?
LoRaWAN ABP example => DevEUI
Connecting the lopy to my lorank8 gateway

Firmware

How to solve the firmware update failures
Exciting open source news!
Firmware source code?

FTP

Username: micro
Password: python

Boot-Mode and Safe-Mode

Boot modes and safe boot
Safe boot

Using “The Things Network”

LoPy Usage

>>> CTRL-D
PYB: soft reboot
MicroPython v1.8.6-464-g0f843911 on 2017-02-17; LoPy with ESP32
Type "help()" for more information.

>>> import os
>>> os.uname().release
'1.6.3.b2'

>>> os.uname()
(sysname='LoPy', nodename='LoPy', release='1.6.3.b2', version='v1.8.6-464-g0f843911 on 2017-02-17', machine='LoPy with ESP32', lorawan='1.0.0')
>>> import binascii
>>> import network
>>> import machine
>>> from network import LoRa

#  Device EUI
>>> lora = LoRa(mode=LoRa.LORAWAN)
>>>print(binascii.hexlify(lora.mac()).upper().decode('utf-8'))
70B3D54994AD77E0

>>> binascii.hexlify(network.LoRa().mac())
b'70b3d5499a6b6439'
>>> binascii.hexlify(machine.unique_id())
b'240ac400c004'
>>> binascii.hexlify(network.WLAN().mac())
b'240ac400c004'
lora = LoRa(mode=LoRa.LORAWAN, sf=7, tx_power=14)
lora.BW_125KHZ
lora.CODING_4_5

# create an OTAA authentication tuple (NWSkey, AppSKey, DevAddr)
auth = (bytes([0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX]),
        bytes([0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX]),
        0x69128CD3 )

lora.join(activation=LoRa.ABP, auth=auth, timeout=0)

while not lora.has_joined():
print('Trying to join LoRa network')
sleep(1)
pass
print('Joined LoRa Network')

pycom.rgbled(GREEN)
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
s.setblocking(False)

while True:
print('Sending Packet')
s.send('Hello from the LoPy')
print('Done sending')
sleep(2)
import pycom
import machine
import time

pycom.heartbeat(False)

led=machine.Pin("G16",machine.Pin.OUT)
button=machine.Pin("G17",machine.Pin.IN, pull=machine.Pin.PULL_UP)

def handler(button):
    led.toggle()

irq=button.callback(trigger=button.IRQ_FALLING, handler=handler)

Change Frequency

Changing Frequency region after upgrade
class LoRa

Leave a Reply

Your email address will not be published.