Error using CC26X2R1 in docker

Hi,

I have two CC26X2R1’s. I flashed them with the coordinator firmware 20191106 from https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_3.x.0/bin.

With both I got this error:

    zigbee2mqtt    | zigbee2mqtt:info  2020-01-04 10:15:39: Logging to console and directory: '/app/data/log/2020-01-04.10-15-39'
    zigbee2mqtt    | zigbee2mqtt:info  2020-01-04 10:15:39: Starting zigbee2mqtt version 1.8.0 (commit #da4d26a)
    zigbee2mqtt    | zigbee2mqtt:info  2020-01-04 10:15:39: Starting zigbee-herdsman...
    zigbee2mqtt    | zigbee2mqtt:error 2020-01-04 10:15:47: Error while starting zigbee-herdsman
    zigbee2mqtt    | zigbee2mqtt:error 2020-01-04 10:15:47: Failed to start zigbee
    zigbee2mqtt    | zigbee2mqtt:error 2020-01-04 10:15:47: Exiting...
    zigbee2mqtt    | zigbee2mqtt:error 2020-01-04 10:15:47: Error: SRSP - SYS - version after 6000ms
    zigbee2mqtt    |     at Timeout.object.timer.setTimeout [as _onTimeout] (/app/node_modules/zigbee-herdsman/dist/utils/waitress.js:44:24)
    zigbee2mqtt    |     at ontimeout (timers.js:436:11)
    zigbee2mqtt    |     at tryOnTimeout (timers.js:300:5)
    zigbee2mqtt    |     at listOnTimeout (timers.js:263:5)
    zigbee2mqtt    |     at Timer.processTimers (timers.js:223:10)
    zigbee2mqtt    | npm ERR! code ELIFECYCLE
    zigbee2mqtt    | npm ERR! errno 1
    zigbee2mqtt    | npm ERR! zigbee2mqtt@1.8.0 start: `node index.js`
    zigbee2mqtt    | npm ERR! Exit status 1
    zigbee2mqtt    | npm ERR!
    zigbee2mqtt    | npm ERR! Failed at the zigbee2mqtt@1.8.0 start script.
    zigbee2mqtt    | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    zigbee2mqtt    |
    zigbee2mqtt    | npm ERR! A complete log of this run can be found in:
    zigbee2mqtt    | npm ERR!     /root/.npm/_logs/2020-01-04T09_15_47_193Z-debug.log

My docker compose config:

  zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt
    user: root
    volumes:
      - ${CONFIG}/zigbee2mqtt:/app/data
    devices:
      - "/dev/ttyACM1:/dev/ttyACM1"
    restart: always
    privileged: true
    #network_mode: host
    environment:
      - TZ=${TZ}

Anybody ideas what I could try next?

I have tried to remove database.db and state.json. Next, changed pan id.
Versions of the docker image change to 1.7.1 and latest-dev.

But all give the same error…

Ok, got it working finally!!

First problem was that I had to use /dev/ttyACM0 this is the data port, the /dev/ttyACM1 is the debug port. I found this in this thread: https://github.com/ioBroker/ioBroker.zigbee/issues/387

Next I got this error:

igbee2mqtt    | zigbee2mqtt:error 2020-01-04 21:03:56: Error: SREQ '--> SYS - osalNvWrite - {"id":3,"len":1,"offset":0,"value":{"type":"Buffer","data":[2]}}' failed with status '2' (expected '0')
zigbee2mqtt    |     at Znp.<anonymous> (/app/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:245:27)
zigbee2mqtt    |     at Generator.next (<anonymous>)
zigbee2mqtt    |     at fulfilled (/app/node_modules/zigbee-herdsman/dist/adapter/z-stack/znp/znp.js:5:58)
zigbee2mqtt    | npm ERR! code ELIFECYCLE
zigbee2mqtt    | npm ERR! errno 1
zigbee2mqtt    | npm ERR! zigbee2mqtt@1.8.0 start: `node index.js`
zigbee2mqtt    | npm ERR! Exit status 1
zigbee2mqtt    | npm ERR!
zigbee2mqtt    | npm ERR! Failed at the zigbee2mqtt@1.8.0 start script.
zigbee2mqtt    | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

To fix this, I found that the flash procedure is not complete. Found this on: https://github.com/Koenkk/zigbee2mqtt/issues/1429

To flash:

  1. connect the board to a free USB port on the PC
  2. open the UniFlash Tool
  3. perform a manually erase of the chip, to do this go to the “Settings & Utilities” menu and set the option “Erase entire flash (You must reconnect to the target afterwards)” on the manual erase section and perform the erase.
  4. close UniFlash
  5. disconnect and reconnect the board to the USB PC port
  6. reopen UniFlash
  7. Under the “Settings & Utilities” menu change the option inside the “Erase Settings during Program Load” section to the "All Unprotected Sectors"
  8. Load the .hex file
  9. Flash the firmware
  10. close UniFlash