Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue #102 #103

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

yatch
Copy link

@yatch yatch commented Jun 3, 2019

This PR introduces two changes for Issue #102:

  • create a separate firmware file for each mote (applied only to --testbed=opentestbed case)
  • reset a mote before programming

When programming motes one by one with a certain interval, cc2538-bsl.py fails saying "Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)'". I suspected that the serial port was not cleanly released when cc2538-bsl.py started, but seems this is not true.

After some trial-and-error iterations, I found resetting a mote just before programming gives better success rate for programming.

Here are logs of my script after adding reset() to `_mqtt_handler_program():

2019-06-03 16:41:11,516: [INFO] Start programming "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b5-77
2019-06-03 16:41:14,521: [INFO] Start programming "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b5-9b
2019-06-03 16:41:17,524: [INFO] Start programming "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b6-06
2019-06-03 16:41:20,529: [INFO] Start programming "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b6-30
2019-06-03 16:41:24,693: [INFO] Succeed to program "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b5-77
2019-06-03 16:41:27,523: [INFO] Succeed to program "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b5-9b
2019-06-03 16:41:30,670: [INFO] Succeed to program "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b6-06
2019-06-03 16:41:33,290: [INFO] Succeed to program "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b6-30

Without reset(), programing failed 3 out of 4:

2019-06-03 16:36:54,014: [INFO] Start programming "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b5-77
2019-06-03 16:36:57,018: [INFO] Start programming "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b5-9b
2019-06-03 16:37:00,021: [INFO] Start programming "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b6-06
2019-06-03 16:37:03,026: [INFO] Start programming "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b6-30
2019-06-03 16:37:03,099: [ERROR] Failed to program "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b5-9b
2019-06-03 16:37:06,010: [ERROR] Failed to program "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b6-06
2019-06-03 16:37:09,045: [INFO] Succeed to program "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b5-77
2019-06-03 16:37:09,072: [ERROR] Failed to program "openwsn-openmote-b-24ghz.ihex" to 00-12-4b-00-14-b5-b6-30

This PR has other minor improvements as well.

yatch added 4 commits May 31, 2019 11:25
Currently, a client has no clue why firmware programming fails by
seeing a response, which says only AssertionError happened by "assert
mote['bootload_success'] ==True".

With this change, the client could have raw outputs, stdout and
stderr, by cc2538-bsl.py, which may help for troubleshooting.
…r each mote

This change is applied to only OpenTestbed
With this reset, firmware programming succeeds even without
time.sleep(2), which is removed by this commit.
@yatch
Copy link
Author

yatch commented Jun 3, 2019

Fix Issue #104 as well.

@yatch
Copy link
Author

yatch commented Jun 3, 2019

discovermotes sometimes fails with the same error, "Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)"

Traceback (most recent call last):
  File "/home/opentestbed/latest/otbox.py", line 380, in _execute_command_safely
    returnVal['returnVal'] =  cmd_handler(deviceType, deviceId, payload)
  File "/home/opentestbed/latest/otbox.py", line 471, in _mqtt_handler_discovermotes
    firmware_file         = self.tb.firmware_eui64_retrieval,
  File "/home/opentestbed/latest/otbox.py", line 699, in _bootload_motes
    raise RuntimeError(stdout, stderr)
RuntimeError: ('', "Opening port /dev/openmote-b_3, baud 400000\nReading data from /home/opentestbed/latest/bootloaders/opentestbed/01bsp_eui64_prog.ihex\nYour firmware looks like an Intel Hex file\nConnecting to target...\nERROR: Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)'\n")

@yatch yatch force-pushed the pr/bugfix_in_serial branch 2 times, most recently from 8964de6 to 09c9134 Compare June 4, 2019 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant