• Lopy and SIM800L connection

    lora lopy sim800
    2
    0 Votes
    2 Posts
    362 Views
    R
    @iplooky Hi, I think I am looking for the same concept to. My case is to implement a Lora Nano-GTW and use a SIM808 to backhaul the data via GPRS. Is it the same case you have? I am actually a the planning stage. If you have advanced something, please share your ideas. I am thinking to do it with an arduino module. I am going to try to create a serial connection with it and also connect other arduino's pins with the SIM808 and create another serial Then I guess hard code programming should be necessary in order to create the flux of information between the pycom to an arduino's logical buffer and then to the SIM808 to be transmitted to some internet server through GPRS cell network. Please, destroy my idea with anything. Thanks to all.
  • Ad-hoc LoRaMesh networks

    pymesh
    2
    1 Votes
    2 Posts
    493 Views
    catalinC
    hi @sysfrog, I'm very sorry for completely missing this thread. Yes, full LoRaWAN gateways are pretty power hungry as always listening on 8 channels. Given 3 months old topic, is there still interest into this project? We could have a chat about it (please PM me). We could find the right Pymesh configuration/customisation to accomplish your requirements.
  • 0 Votes
    11 Posts
    5k Views
    C
    This error statement TypeError: 'module' object is not callable is raised as you are being confused about the Class name and Module name. The problem is in the import line . You are importing a module, not a class. This happend because the module name and class name have the same name . If you have a class "MyClass" in a file called "MyClass.py" , then you should import : from MyClass import MyClass In Python , a script is a module, whose name is determined by the filename . So when you start out your file MyClass.py with import MyClass you are creating a loop in the module structure. In Python, everything (including functions, methods, modules, classes etc.) is an object , and methods are just attributes like every others. So,there's no separate namespaces for methods. So when you set an instance attribute, it shadows the class attribute by the same name. The obvious solution is to give attributes different names.
  • Porting adafruit TSL2591 micropython to Pycom library

    lopy4
    3
    0 Votes
    3 Posts
    552 Views
    D
    I made those changes and worked thru a few more issues. I get output the first time thru then it breaks. Still working through that but here's what I've got so far Serial output: [41, 64] [41, 64] [41, 64] [41, 64] [41, 64] Total light: 55.55328lux [41, 64] [41, 64] Infrared light: 141 [41, 64] [41, 64] Visible light: 9241007 [41, 64] [41, 64] Full spectrum (IR + visible) light: 9241149 [41, 64] [41, 64] Total light: 0.0lux [41, 64] [41, 64] Infrared light: 0 [41, 64] [41, 64] Visible light: 0 [41, 64] [41, 64] Full spectrum (IR + visible) light: 0 the zero outputs repeat the rest of the tries. tsl2591.py: # The MIT License (MIT) # # Copyright (c) 2017 Tony DiCola for Adafruit Industries # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ `adafruit_tsl2591` ==================================================== CircuitPython module for the TSL2591 precision light sensor. See examples/simpletest.py for a demo of the usage. * Author(s): Tony DiCola Implementation Notes -------------------- **Hardware:** * Adafruit `TSL2591 High Dynamic Range Digital Light Sensor <https://www.adafruit.com/product/1980>`_ (Product ID: 1980) **Software and Dependencies:** * Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: https://github.com/adafruit/circuitpython/releases * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice """ from micropython import const #import adafruit_bus_device.i2c_device as i2c_device from machine import I2C,Pin #__version__ = "0.0.0-auto.0" #__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_TSL2591.git" #pylint: disable=bad-whitespace # Internal constants: _TSL2591_ADDR = const(0x29) _TSL2591_COMMAND_BIT = const(0xA0) _TSL2591_ENABLE_POWEROFF = const(0x00) _TSL2591_ENABLE_POWERON = const(0x01) _TSL2591_ENABLE_AEN = const(0x02) _TSL2591_ENABLE_AIEN = const(0x10) _TSL2591_ENABLE_NPIEN = const(0x80) _TSL2591_REGISTER_ENABLE = const(0x00) _TSL2591_REGISTER_CONTROL = const(0x01) _TSL2591_REGISTER_DEVICE_ID = const(0x12) _TSL2591_REGISTER_CHAN0_LOW = const(0x14) _TSL2591_REGISTER_CHAN1_LOW = const(0x16) _TSL2591_LUX_DF = 408.0 _TSL2591_LUX_COEFB = 1.64 _TSL2591_LUX_COEFC = 0.59 _TSL2591_LUX_COEFD = 0.86 _TSL2591_MAX_COUNT_100MS = const(36863) # 0x8FFF _TSL2591_MAX_COUNT = const(65535) # 0xFFFF # User-facing constants: GAIN_LOW = 0x00 # low gain (1x) """Low gain (1x)""" GAIN_MED = 0x10 # medium gain (25x) """Medium gain (25x)""" GAIN_HIGH = 0x20 # medium gain (428x) """High gain (428x)""" GAIN_MAX = 0x30 # max gain (9876x) """Max gain (9876x)""" INTEGRATIONTIME_100MS = 0x00 # 100 millis """100 millis""" INTEGRATIONTIME_200MS = 0x01 # 200 millis """200 millis""" INTEGRATIONTIME_300MS = 0x02 # 300 millis """300 millis""" INTEGRATIONTIME_400MS = 0x03 # 400 millis """400 millis""" INTEGRATIONTIME_500MS = 0x04 # 500 millis """500 millis""" INTEGRATIONTIME_600MS = 0x05 # 600 millis """600 millis""" #pylint: enable=bad-whitespace class TSL2591: """TSL2591 high precision light sensor. :param busio.I2C i2c: The I2C bus connected to the sensor :param int address: The I2C address of the sensor. If not specified the sensor default will be used. """ # Class-level buffer to reduce memory usage and allocations. # Note this is NOT thread-safe or re-entrant by design. _BUFFER = bytearray(2) def __init__(self, i2c, address=_TSL2591_ADDR): self._integration_time = 0 self._gain = 0 self.i2c=i2c#I2C(pins=("P9","P10")) self._i2c_address=address #self._device = i2c_device.I2CDevice(i2c, address) # Verify the chip ID. if self._read_u8(_TSL2591_REGISTER_DEVICE_ID) != 0x50: raise RuntimeError('Failed to find TSL2591, check wiring!') # Set default gain and integration times. self.gain = GAIN_MED self.integration_time = INTEGRATIONTIME_100MS # Put the device in a powered on state after initialization. self.enable() def _read_u8(self, address): # Read an 8-bit unsigned value from the specified 8-bit address. #with self._device as i2c: # Make sure to add command bit to read request. #self._BUFFER[0] = (_TSL2591_COMMAND_BIT | address) & 0xFF # self.i2c.writeto(self._BUFFER, end=1, stop=False) #self.i2c.writeto(_TSL2591_ADDR,self._BUFFER) #self.i2c.readinto(self._BUFFER, end=1) print(self.i2c.scan()) self.i2c.readfrom_mem_into(self._i2c_address,(_TSL2591_COMMAND_BIT|address) & 0xFF,self._BUFFER) return self._BUFFER[0] # Disable invalid name check since pylint isn't smart enough to know LE # is an abbreviation for little-endian. #pylint: disable=invalid-name def _read_u16LE(self, address): # Read a 16-bit little-endian unsigned value from the specified 8-bit # address. #with self._device as i2c: # Make sure to add command bit to read request. #self._BUFFER[0] = (_TSL2591_COMMAND_BIT | address) & 0xFF #self.i2c.write(self._BUFFER, end=1, stop=False) #self.i2c.readinto(self._BUFFER, end=2) print(self.i2c.scan()) self.i2c.readfrom_mem_into(self._i2c_address,(_TSL2591_COMMAND_BIT|address) & 0xFF,self._BUFFER) return (self._BUFFER[1] << 8) | self._BUFFER[0] #pylint: enable=invalid-name def _write_u8(self, address, val): # Write an 8-bit unsigned value to the specified 8-bit address. #with self._device as i2c: # Make sure to add command bit to write request. #self._BUFFER[0] = (_TSL2591_COMMAND_BIT | address) & 0xFF #self._BUFFER[1] = val & 0xFF #self.i2c.write(self._BUFFER, end=2) self.i2c.writeto_mem(self._i2c_address,(_TSL2591_COMMAND_BIT | address) & 0xFF,val & 0xFF) def enable(self): """Put the device in a fully powered enabled mode.""" self._write_u8(_TSL2591_REGISTER_ENABLE, _TSL2591_ENABLE_POWERON | \ _TSL2591_ENABLE_AEN | _TSL2591_ENABLE_AIEN | \ _TSL2591_ENABLE_NPIEN) def disable(self): """Disable the device and go into low power mode.""" self._write_u8(_TSL2591_REGISTER_ENABLE, _TSL2591_ENABLE_POWEROFF) @property def gain(self): """Get and set the gain of the sensor. Can be a value of: - ``GAIN_LOW`` (1x) - ``GAIN_MED`` (25x) - ``GAIN_HIGH`` (428x) - ``GAIN_MAX`` (9876x) """ control = self._read_u8(_TSL2591_REGISTER_CONTROL) return control & 0b00110000 @gain.setter def gain(self, val): assert val in (GAIN_LOW, GAIN_MED, GAIN_HIGH, GAIN_MAX) # Set appropriate gain value. control = self._read_u8(_TSL2591_REGISTER_CONTROL) control &= 0b11001111 control |= val self._write_u8(_TSL2591_REGISTER_CONTROL, control) # Keep track of gain for future lux calculations. self._gain = val @property def integration_time(self): """Get and set the integration time of the sensor. Can be a value of: - ``INTEGRATIONTIME_100MS`` (100 millis) - ``INTEGRATIONTIME_200MS`` (200 millis) - ``INTEGRATIONTIME_300MS`` (300 millis) - ``INTEGRATIONTIME_400MS`` (400 millis) - ``INTEGRATIONTIME_500MS`` (500 millis) - ``INTEGRATIONTIME_600MS`` (600 millis) """ control = self._read_u8(_TSL2591_REGISTER_CONTROL) return control & 0b00000111 @integration_time.setter def integration_time(self, val): assert 0 <= val <= 5 # Set control bits appropriately. control = self._read_u8(_TSL2591_REGISTER_CONTROL) control &= 0b11111000 control |= val self._write_u8(_TSL2591_REGISTER_CONTROL, control) # Keep track of integration time for future reading delay times. self._integration_time = val @property def raw_luminosity(self): """Read the raw luminosity from the sensor (both IR + visible and IR only channels) and return a 2-tuple of those values. The first value is IR + visible luminosity (channel 0) and the second is the IR only (channel 1). Both values are 16-bit unsigned numbers (0-65535). """ # Read both the luminosity channels. channel_0 = self._read_u16LE(_TSL2591_REGISTER_CHAN0_LOW) channel_1 = self._read_u16LE(_TSL2591_REGISTER_CHAN1_LOW) return (channel_0, channel_1) @property def full_spectrum(self): """Read the full spectrum (IR + visible) light and return its value as a 32-bit unsigned number. """ channel_0, channel_1 = self.raw_luminosity return (channel_1 << 16) | channel_0 @property def infrared(self): """Read the infrared light and return its value as a 16-bit unsigned number. """ _, channel_1 = self.raw_luminosity return channel_1 @property def visible(self): """Read the visible light and return its value as a 32-bit unsigned number. """ channel_0, channel_1 = self.raw_luminosity full = (channel_1 << 16) | channel_0 return full - channel_1 @property def lux(self): """Read the sensor and calculate a lux value from both its infrared and visible light channels. """ channel_0, channel_1 = self.raw_luminosity # Compute the atime in milliseconds atime = 100.0 * self._integration_time + 100.0 # Set the maximum sensor counts based on the integration time (atime) setting if self._integration_time == INTEGRATIONTIME_100MS: max_counts = _TSL2591_MAX_COUNT_100MS else: max_counts = _TSL2591_MAX_COUNT # Handle overflow. if channel_0 >= max_counts or channel_1 >= max_counts: raise RuntimeError('Overflow reading light channels!') # Calculate lux using same equation as Arduino library: # https://github.com/adafruit/Adafruit_TSL2591_Library/blob/master/Adafruit_TSL2591.cpp again = 1.0 if self._gain == GAIN_MED: again = 25.0 elif self._gain == GAIN_HIGH: again = 428.0 elif self._gain == GAIN_MAX: again = 9876.0 cpl = (atime * again) / _TSL2591_LUX_DF lux1 = (channel_0 - (_TSL2591_LUX_COEFB * channel_1)) / cpl lux2 = ((_TSL2591_LUX_COEFC * channel_0) - (_TSL2591_LUX_COEFD * channel_1)) / cpl return max(lux1, lux2) main.py: # Simple demo of the TSL2591 sensor. Will print the detected light value # every second. import time from machine import I2C, Pin #added for tsl2591 sensor #import board #import busio import tsl2591 #i2c = I2C(0, pins=("P9","P10")) # Initialize the I2C bus. i2c = I2C(0,pins=("P9","P10"))#board.SCL, board.SDA) #i2c=i2c i2c.init(I2C.MASTER, baudrate=9600) # Initialize the sensor. sensor = tsl2591.TSL2591(i2c) # You can optionally change the gain and integration time: #sensor.gain = adafruit_tsl2591.GAIN_LOW (1x gain) #sensor.gain = adafruit_tsl2591.GAIN_MED (25x gain, the default) #sensor.gain = adafruit_tsl2591.GAIN_HIGH (428x gain) #sensor.gain = adafruit_tsl2591.GAIN_MAX (9876x gain) #sensor.integration_time = adafruit_tsl2591.INTEGRATIONTIME_100MS (100ms, default) #sensor.integration_time = adafruit_tsl2591.INTEGRATIONTIME_200MS (200ms) #sensor.integration_time = adafruit_tsl2591.INTEGRATIONTIME_300MS (300ms) #sensor.integration_time = adafruit_tsl2591.INTEGRATIONTIME_400MS (400ms) #sensor.integration_time = adafruit_tsl2591.INTEGRATIONTIME_500MS (500ms) #sensor.integration_time = adafruit_tsl2591.INTEGRATIONTIME_600MS (600ms) # Read the total lux, IR, and visible light levels and print it every second. while True: # Read and calculate the light level in lux. lux = sensor.lux print('Total light: {0}lux'.format(lux)) # You can also read the raw infrared and visible light levels. # These are unsigned, the higher the number the more light of that type. # There are no units like lux. # Infrared levels range from 0-65535 (16-bit) infrared = sensor.infrared print('Infrared light: {0}'.format(infrared)) # Visible-only levels range from 0-2147483647 (32-bit) visible = sensor.visible print('Visible light: {0}'.format(visible)) # Full spectrum (visible + IR) also range from 0-2147483647 (32-bit) full_spectrum = sensor.full_spectrum print('Full spectrum (IR + visible) light: {0}'.format(full_spectrum)) time.sleep(1.0)
  • Http get LoPy freeze

    lopy http get freeze
    10
    1
    0 Votes
    10 Posts
    1k Views
    C
    @crumble Thanks! ... it did the trick
  • Changing the Lopy4's Wi-Fi AP SSID name

    lopy4 wifi ssid setup
    2
    0 Votes
    2 Posts
    388 Views
    M
    wl.init(mode=WLAN.STA_AP, ssid="apssid", auth=(WLAN.WPA2,'12378'), channel=7, antenna=WLAN.INT_ANT) available_nets = wl.scan()
  • Lopy4 433MHz

    lopy4 433mhz
    25
    1 Votes
    25 Posts
    5k Views
    bmarkusB
    @robert-hh said in Lopy4 433MHz: @bmarkus Standard build of Pycom. You know that I made a version of the pycom firmware and tested that against LORIOT. It worked. I see, thanks. I was not sure your are referring to the LoRa Alliance or PyCom
  • Is the L01 specsheet correct?

    lopy specs
    2
    0 Votes
    2 Posts
    281 Views
    robert-hhR
    @thosch42 The LED is indeed connected to P2 = GPIO0.
  • Data Rate of LoRa experiments

    lora range data rate
    10
    0 Votes
    10 Posts
    975 Views
    bmarkusB
    @snehasg96 said in Data Rate of LoRa experiments: @bmarkus Thank you! So if I understood you correctly, sending a packet of payload say less than 64 bytes should be good? Also do you mean i should include the SF to a value between 6-12 in my code? Appreciate your feedback. I say use payload which is within the allowed size and represent a typical size let say around 8-10 bytes. Use the lowest DR (highest SF) which is DR0/SF12 for EU868 and add other DR, DR1...DR5 to see how distance varies by DR. SF6 is not valid for SX127x device chipsets and for Gateways. Please note, LoRa packets can be travel for a long distance randomly, but do not expect that long distance you see for few packets will work in a production environment. Be conservative and base your decision on larger number of samples.
  • Lopy4 - 3.3V out disable?

    lopy4 3.3v machine.deepsle
    8
    0 Votes
    8 Posts
    770 Views
    M
    @jcaron The ESP32 data sheet https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf says high level source current IOH is 20 or 40 mA, depending on domain. The voltage will probably be quite noisy as it comes from the digital supply of the ESP32. The HX711 is a 24 bit sigma delta front end for load cells. For optimal performance, I'd power this from a separate regulator, but try it... If you look at the data sheet https://www.mouser.com/ds/2/813/hx711_english-1022875.pdf you see it has an internal analog regulator. Running from a 3.3 V supply, I'd set the analog voltage to 3.0 V, which would at least reduce the noise. Also note that the IO driver of the ESP32 (or any digital device) has a much higher resistance than an external FET switch you'd typically use (there are no specs on this in the datasheet), introducing additional errors.
  • AttributeError: 'I2C' object has no attribute '__exit__'

    lopy4 htu21d
    3
    0 Votes
    3 Posts
    482 Views
    D
    Thanks! After clearing that error, I ran into several more. This is what I ended up with when I got it working finally /flash/lib/htu21d.py: # The MIT License (MIT) # # Copyright (c) 2018 ktown for Adafruit Industries # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ `adafruit_htu21d` ==================================================== This is a breakout for the Adafruit HTU21D-F humidity sensor breakout. * Author(s): ktown Implementation Notes -------------------- **Hardware:** * Adafruit `HTU21D-F Temperature & Humidity Sensor Breakout Board <https://www.adafruit.com/product/1899>`_ (Product ID: 1899) **Software and Dependencies:** * Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice """ from machine import I2C import struct HTU21D_I2CADDR=const(0x40) HUMIDITY = const(0xf5) TEMPERATURE = const(0xf3) _RESET = const(0xfe) _READ_USER1 = const(0xe7) _USER1_VAL = const(0x3a) def _crc(data): crc = 0 for byte in data: crc ^= byte for _ in range(8): if crc & 0x80: crc <<= 1 crc ^= 0x131 else: crc <<= 1 return crc class HTU21D: #HTU21D_I2CADDR=const(0x40) #HUMIDITY = const(0xf5) #TEMPERATURE = const(0xf3) #_RESET = const(0xfe) #_READ_USER1 = const(0xe7) #_USER1_VAL = const(0x3a) """ A driver for the HTU21D-F temperature and humidity sensor. :param i2c_bus: The `busio.I2C` object to use. This is the only required parameter. :param int address: (optional) The I2C address of the device. """ def __init__(self, sda = 'P9', scl = 'P10'): self.i2c_device = I2C(0, mode=I2C.MASTER, pins=(sda, scl)) self._command(_RESET) self._measurement = 0 self.addr = HTU21D_I2CADDR def _command(self, command): #with self.i2c_device as i2c: self.i2c_device.writeto(HTU21D_I2CADDR, command) def _data(self): data = bytearray(3) while True: # While busy, the sensor doesn't respond to reads. try: #with self.i2c_device as i2c: self.i2c_device.readfrom_into(self.addr, data) if data[0] != 0xff: # Check if read succeeded. break except OSError: pass value,checksum=struct.unpack('>HB',data) if checksum != _crc(data[:2]): raise ValueError('CRC mismatch:'+data+':'+checksum+':') return value @property def relative_humidity(self): """The measured relative humidity in percent.""" self.measurement(HUMIDITY) self._measurement = 0 return self._data() * 125.0 / 65536.0 - 6.0 @property def temperature(self): """The measured temperature in degrees Celcius.""" self.measurement(TEMPERATURE) self._measurement = 0 return self._data() * 175.72 / 65536.0 - 46.85 def measurement(self, what): """ Starts a measurement. Starts a measurement of either ``HUMIDITY`` or ``TEMPERATURE`` depending on the ``what`` argument. Returns immediately, and the result of the measurement can be retrieved with the ``temperature`` and ``relative_humidity`` properties. This way it will take much less time. This can be useful if you want to start the measurement, but don't want the call to block until the measurement is ready -- for instance, when you are doing other things at the same time. """ if what not in (HUMIDITY, TEMPERATURE): raise ValueError() if not self._measurement: self._command(what) elif self._measurement != what: raise RuntimeError("other measurement in progress") self._measurement = what```
  • lopy sigfox know if message is sent

    lopy4 sigfox gps callback
    2
    0 Votes
    2 Posts
    350 Views
    E
    @raaden89 Simply you can't. Sigfox as very very low downlink ability ( network to your device as 4*8 bytes limits per day!) . You just can't design this functionnality as is, and you need to think to another way to work. exemple:wait in your device for a downlink coming from sigfox with a sequencial number index, send after that the gps pos with following index and so on. On the next download your device will receive a new index (or the same at the last time if no uplink as been successfull) and your device will restart to send the gps pos following the index recevied.
  • Logging crash error to the SD card.

    error log sd card pycom crash
    1
    1 Votes
    1 Posts
    277 Views
    No one has replied
  • Can't get Join accept from Multitech gateway

    multitech lopy
    15
    0 Votes
    15 Posts
    1k Views
    T
    Hi everyone I figured it out that the Gateway is using "MTS Private " network which is Multitech's proprietary Lora network for their product. I switched back to LoraWAN Private and it worked just fine. Thank you for your help
  • Sock_stream in Lopy ?

    lopy socket lora sockstream
    4
    0 Votes
    4 Posts
    448 Views
    P
    @snehasg96 Not without significant development effort. And honestly you would not want to. Lora just isnt setup for that kind of two way comm's without a ton of latency and bandwith issues.
  • How to set join request SF in OTAA mode?

    lopy otaa ttn
    4
    1
    0 Votes
    4 Posts
    653 Views
    E
    @miroslav-petrov Hi, yes adr need to be driven by gateway. In pycom documentation adr is parameter of lora constructor. So what make you said it's not work ? As far i know some network compute adr setting only after a big sample of rx frame (for a nation wide operator in france they use approximatly one hundred of frame before send first downlink adr request to my device). Does your gateway show if adr is set in your uplink frame ?
  • LoPy as a gateway send packet under TCP/IP

    server lorawan lopy gateway
    3
    0 Votes
    3 Posts
    1k Views
    S
    @jmarcelino said in LoPy as a gateway send packet under TCP/IP: don’t recommend running TCP over LoRa itself. Sir, can you please elaborate more on how to change the lora packet data into tcp/ip format?
  • TTN ABP from LoPy4 loses many packets despite low RSSI

    ttn lora
    6
    0 Votes
    6 Posts
    694 Views
    D
    @jcaron Thanks for recommending the range adjustment. I've added that to my code.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    13 Views
    No one has replied
  • LOPY SPI Mikroe click module

    lopy spi sensor
    4
    0 Votes
    4 Posts
    506 Views
    robert-hhR
    @johncaipa said in LOPY SPI Mikroe click module: adc = (((buf[0] << 8) | buf[1]) & 0xfff) >>1 That one is wrong. You have to shift the raw value befor masking. The lowest bit of the returned value will not be at bit0 of adc, so you have to shift to to the right. Reason: The adc starts shifting out values at the 2nd (or third?) clock cycle, and SPI will create 16 clock cycles. So there are like 14 bits in the result buffer, of which only the high order 12 bits are valid. The others have to be discarded and the value has to be properly aligned. If you use a separate CS pin, you can simply use spi.read_into(). spi.read_into(buf) adc = ((buf[0] << 8) | buf[1]) >> x) & 0xfff x should be a value between 1 and 3. Best is to determine it experimentally. The conv variable and write_readinto() is only used to create the CS signal at the MOSI pin. By using an appropriate pattern for conv, like 0x8000, 0xc000, of 0xe000, you can shift the CS signal in clock steps, making the final shift of the result obsolete. So doing that save a pin and saves a few instructions.

Pycom on Twitter