WiPy 3.0 BLE server handler take 2 positional arguments



  • Hi Everyone,

    I hope someone can help me. I am following the GATTSCharacteristic example in the docs, however, I am receiving the following error from the callback handler.

    TypeError: function takes 2 positional arguments but 1 were given
    

    I am sending data to the characteristic via nRF Connect Android app.
    If I try to print the arguments passed with the following code:

    def char1_cb_handler(chr, arg1=None):
        print (sys.argv[1:])
        print("Receiving some value")
        # (events, value) = data
        # if  events & Bluetooth.CHAR_WRITE_EVENT:
        #     print("Write request with value = {}".format("hello"))
        # else:
        #     print('Read request on char 1')
    

    I get and empty array for the arguments

    []
    Receiving some value
    

    Also if I read the value from the characteristic the board freezes.

    I think I might need a firmware update on the WiPy, however, I can't run the Pycom Firmware Update software for Mac on Catalina.
    I get this message:

    This software needs to be updated. Contact the developer for more information.

    How can I adapt the characteristic callback handler to receive the values sent, as well as read the values without the board freezing? If I need to update the firmware of the board, is there a way that I can do this without the Pycom Firmware or atleast get this software to work on Mac Catalina?

    Thank you very much for the help in advance!



  • @RuCilo said in WiPy 3.0 BLE server handler take 2 positional arguments:

    This software needs to be updated. Contact the developer for more information.

    Right-click on the Updater, then Open. In the alert, click Open.

    This is just because it's not signed, and only the first time after downloading it.


  • Global Moderator

    That's weird, I have no issues with the firmware updater tool on MacOS. I believe it is telling you to update the tool itself, or that you need to set the privacy settings to allow for 3'rd party apps to run.. For some reason we have no certification on the tool, but I can assure you there's no malware :)

    Gijs



  • @RuCilo said in WiPy 3.0 BLE server handler take 2 positional arguments:

    If I need to update the firmware of the board, is there a way that I can do this without the Pycom Firmware or atleast get this software to work on Mac Catalina?

    Mac does not like the Firmware Update tool indeed, we have had so many issues with it.

    I think what you can do is to re-download it: https://pycom.io/downloads/.

    If that doesn't work, there is a command line interface available which you can use by doing some terminal commands. See: https://docs.pycom.io/advance/cli/.

    If you still have issues, reply to me, since I have had to troubleshoot this further in the past...

    Good luck!


Log in to reply
 

Pycom on Twitter