This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Bluetooth mesh serial example issues.

Hi,

I tried the serial example on the PCA10028/PCA10031 and PCA10040. I found that this demo will fail on both PCA10031 and PCA10040, like this:

Activating auto-logging. Current session state plus future input saved. Filename : COM6_17-235-13-43.log Mode : backup Output logging : False Raw input log : False Timestamping : False State
: active Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] Type 'copyright', 'credits' or 'license' for more information IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: send(Echo("hello world")) 2017-08-23 13:43:54,579 - INFO - cmd Echo, timeout waiting for event

"Echo, timeout waiting for event" means?

The second issue is that, I can "erase all" on PCA10028 but it will fail when download the "serial" by SEGGER embedded studio. Anybody found the same issue?

  • Could you explain a bit more what you are doing? When and where do you get this timeout?

    I don't have any problems downloading the example in SES, have you chosen the serial example as the active one? Are you able to compile?

  • I try this demo on other PC, which is Win10 64bit like previous one. But the Python is 32-bit version. Looks it works. So may I say the "serial" demo need Python 32bit not 64bit version?

    ble_mesh_v0.9.1-Alpha\scripts\interactive_pyaci>python interactive_pyaci.py -d COM22
    
        To control your device use d[x], type d[x]. and hit tab to see the available methods.
        x is for the device index; devices will be indexed based on the order of com ports
        given with the option -d(the first device, d[0], can also be accessed using device).
        The log will be available in the calling directory as COM22_17-236-11-2.outlog
    2017-08-24 11:02:13,815 - ERROR - Unable to deserialize bytearray(b'\x02\x00c')
    Activating auto-logging. Current session state plus future input saved.
    Filename       : COM22_17-236-11-2.log
    Mode           : backup
    Output logging : False
    Raw input log  : False
    Timestamping   : False
    State          : active
    Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)]
    Type 'copyright', 'credits' or 'license' for more information
    IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.
    
    In [1]: send(Echo("hello world"))
    2017-08-24 11:02:45,114 - INFO - {event: DeviceEchoRsp, data: {'data': bytearray(b'hello world')}}
    
  • I found the same issue on a Slackware64 (64bit) machine:

    (pyaci) giovanni@slackserver:~/development/bluetooth/nordic/nrf5_SDK_for_Mesh_v0.10.1-Alpha_src/scripts/interactive_pyaci$ python interactive_pyaci.py -d /dev/ttyACM0 --no-logfile
    
        To control your device use d[x], type d[x]. and hit tab to see the available methods.
        x is for the device index; devices will be indexed based on the order of com ports
        given with the option -d (the first device, d[0], can also be accessed using device).
    
    Python 3.6.2 (default, Nov 15 2017, 21:59:06) 
    Type 'copyright', 'credits' or 'license' for more information
    IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
    
    In [1]: send(cmd.Echo("hello world"))
    
    In [2]: 2017-12-04 21:56:54,698 - INFO - ttyACM0: cmd Echo, timeout waiting for event
    

    Can you please help me to solve this issue using a 64 bit GNU/Linux machine?

  • You need to disable hardware (RTS/CTS) flow control when init the serial port object.

    class Uart(threading.Thread, Device):
    //def __init__(self, port, baudrate=115200, device_name=None, rtscts=True):
    def __init__(self, port, baudrate=115200, device_name=None, rtscts=False):
        self.events_queue = collections.deque(maxlen=EVT_Q_BUF)
        threading.Thread.__init__(self)
        if not device_name:
            device_name = port
        self.device_name = device_name
        self.logger = logging.getLogger(self.device_name)
        Device.__init__(self, self.device_name)
        self._write_lock = threading.Lock()
        self.logger.debug("log Opening port %s, baudrate %s, rtscts %s", port, baudrate, rtscts)
        self.serial = Serial(port=port, baudrate=baudrate, rtscts=rtscts, timeout=0.1)
        self.keep_running = True
        self.start()
    
Related