Copyright ©

Mongoose OS Forum

ATTENTION! This forum has moved to:

Do not post any new messages.

Problems with CC3200 and aws-iot-setup command

ulsoulso Stockholm

I'm trying to use the mos aws-iot-setup command on my CC3200-based board, and I have run into some problem.

It gets to the point where it says "Uploading certificate". Then I get either of two error messages saying something like Context deadline exceeded or File already closed.

While testing the command some 50 times it seemed to succeed once. It reported a new MQTT configuration and rebooted the device, but the new reported MQTT configuration was not actually saved to the device.

I am using the latest firmware and the latest mos version.


  • SergeySergey Dublin, Ireland

    To clarify, is other functionality like - working or not?

  • ulsoulso Stockholm

    It seems that there is some intermittent problem with writing to the flash. When modifying the init.js file from the mos ui, sometimes when I click the Save button I get an error message and the changes isn't saved.

    Just to be sure this isn't a hardware problem, I tried another board and got the same results.

    It's been a few weeks since I worked on this. I definitely didn't have any problems modifying and saving the init.js file back then.

    I also noticed that after reflashing with the mos flash mos-cc3200 command and then trying to set the WiFi in STA mode using the mos wifi ... command, it didn't work either. It was still in AP mode and the config looked unchanged.

  • ulsoulso Stockholm

    I now tried a third board. This time it's a TI CC3200-LAUNCHXL Rev 4.1.

    First flashed it successfully, but when I issued the mos wifi setup command I got the following messages:

    Using port /dev/cu.usbserial-cc3101B
    Getting configuration...
    Setting new configuration...
    Error: context deadline exceeded
  • SergeySergey Dublin, Ireland

    We reproduced that, this is due to a yesterday's change:

    cc3200's UART buffer is 16 bytes and is too small to cope with large writes without flow control.
    We do run multiple tests on all firmwares for each change, but unfortunately not for mos tool yet.

    Please expect an update shortly.

  • ulsoulso Stockholm

    Thanks. I found another peculiar thing just now. If I do a mos config-get and look at the "wifi" section I get this:

    "wifi": {
        "ap": {
          "channel": 6,
          "dhcp_end": "",
          "dhcp_start": "",
          "enable": true,
          "gw": "",
          "hidden": false,
          "ip": "",
          "max_connections": 10,
          "netmask": "",
          "pass": "Mongoose",
          "ssid": "Mongoose_??????"
        "sta": {
          "dhcp_hostname": "",
          "enable": false,
          "gw": "",
          "ip": "",
          "nameserver": "",
          "netmask": "",
          "pass": "",
          "ssid": ""

    But, the output from mos call Sys.GetInfo doesn't show the same WiFi parameters:

      "app": "mjs_base",
      "fw_version": "1.0",
      "fw_id": "20170428-121205/???",
      "mac": "209148837B79",
      "arch": "cc3200",
      "uptime": 113,
      "ram_size": 48256,
      "ram_free": 24256,
      "ram_min_free": 18040,
      "fs_size": 83081,
      "fs_free": 19076,
      "wifi": {
        "sta_ip": "",
        "ap_ip": "",
        "status": "got ip",
        "ssid": ""
  • SergeySergey Dublin, Ireland

    That's expected. GetInfo returns just the "summary": is it AP or STA, what's the IP address and status.
    Config says what it should be, GetInfo says what it is.

  • ulsoulso Stockholm

    Eagerly waiting for the updated mos tool :)

  • SergeySergey Dublin, Ireland

    please try out,

    mos update
  • ulsoulso Stockholm

    Thanks for the update. Unfortunately the problem still seem to be there.

    I updated both the mos utility and the firmware. I tried both from command line and from the web UI and still got the "context deadline exceeded" at various places.

  • SergeySergey Dublin, Ireland

    What OS are you using?

  • ulsoulso Stockholm

    Also tried again with the TI CC3200-LAUNCHXL board and got the same error.

  • ulsoulso Stockholm

    I'm using macOS Sierra 10.12.4 on a MacBook Pro retina mid 2012.

  • ulsoulso Stockholm

    I have also seen the error message "file already closed" a few times.

  • ulsoulso Stockholm

    Now I installed mos.exe in the c:\Windows directory on a Windows machine and tried everything from there. Unfortunately it didn't work any better there either. Still see the same error messages.

  • rojerrojer Dublin, Ireland

    do you work in JS or C? i'm sad to say, but theJS build of the CC3200 firmware is approaching its limits, in particular in terms of FS space and performance (which are related). if you are not interested in JS, i can show you how to build C-only firmware and that should work better.

  • ulsoulso Stockholm

    I'm no fan of JS so C is perfectly fine with me (been using it since 1979).

  • rojerrojer Dublin, Ireland

    ok. the firmware you flash with "mos flash cc3200" includes JS. you'll want to build your own, based on e.g. c_hello. read the Building Apps in C section - should be as simple as getting the c_hello directory (by cloning the git repo or downloading the zipball) and then running mos build --arch cc3200.

  • ulsoulso Stockholm

    Seems to work ok now thank you.

Sign In or Register to comment.