pycom / pycom-libraries

MicroPython libraries and examples that work out of the box on Pycom's IoT modules
330 stars 378 forks source link

lorawan-nano-gateway won't run : function does not take keyword arguments #61

Closed davidbono closed 6 years ago

davidbono commented 6 years ago

Just trying to execute main.py :


import config
from nanogateway import NanoGateway

if __name__ == '__main__':
    nanogw = NanoGateway(
        id=config.GATEWAY_ID,
        frequency=config.LORA_FREQUENCY,
        datarate=config.LORA_GW_DR,
        ssid=config.WIFI_SSID,
        password=config.WIFI_PASS,
        server=config.SERVER,
        port=config.PORT,
        ntp_server=config.NTP,
        ntp_period=config.NTP_PERIOD_S
        )

    nanogw.start()
    nanogw._log('You may now press ENTER to enter the REPL')
    input()

I obtain the following result by using lopy4 ( last firmware:1.17.5.b6 ) with Atom and pymakr.

Traceback (most recent call last):
  File "<stdin>", line 17, in <module>
TypeError: function does not take keyword arguments

Any help would be much appreciate.

davidbono commented 6 years ago

Fixed by removing keyword arguments :

""" LoPy LoRaWAN Nano Gateway example usage """

import config
from nanogateway import NanoGateway

if __name__ == '__main__':
    print("Hello World")
    nanogw = NanoGateway(
        config.GATEWAY_ID,
        config.LORA_FREQUENCY,
        config.LORA_GW_DR,
        config.WIFI_SSID,
        config.WIFI_PASS,
        config.SERVER,
        config.PORT,
        config.NTP,
        ntp_period=config.NTP_PERIOD_S
        )
    print("Démarrage Gateway")
    nanogw.start()
    print("Démarrée")
    nanogw._log('You may now press ENTER to enter the REPL')
    input()