rojer@nbt:~/cesanta/mongoose-iot/fw/examples/c_mqtt master$
miot build --arch esp32 && miot flash --port /dev/ttyUSB0 --firmware build/fw.zip && miot console --port /dev/ttyUSB0
Connecting to
http://mongoose.cloud, user test
Uploading sources (3073 bytes)
Success, built c_mqtt/esp32 version 1.0 (20161227-175444/???).
Firmware saved to build/fw.zip
Loaded c_mqtt/esp32 version 1.0 (20161227-175444/???)
Opening /dev/ttyUSB0...
Connecting to ESP32 ROM, attempt 1 of 10...
Connected
Running flasher @ 460800...
Flasher is running
Flash size: 4194304, params: 0x0220
Deduping...
3072 @ 0x8000 -> 0
695888 @ 0x10000 -> 626256
131072 @ 0x110000 -> 28672
Writing...
8192 @ 0x1000
192512 @ 0x20000
434176 @ 0x50000
28672 @ 0x110000
Wrote 663552 bytes in 15.84 seconds (327.31 KBit/sec)
Verifying...
6560 @ 0x1000
3072 @ 0x8000
695888 @ 0x10000
131072 @ 0x110000
Booting firmware...
All done!
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57
...
miot_init Init done, RAM: 160716 free, 160716 min free
^C
rojer@nbt:~/cesanta/mongoose-iot/fw/examples/c_mqtt master$
miot config-set --port /dev/ttyUSB0 wifi.ap.enable=false wifi.sta.enable=true wifi.sta.ssid=Cesanta wifi.sta.pass=***
Getting configuration...
Setting new configuration...
rojer@nbt:~/cesanta/mongoose-iot/fw/examples/c_mqtt master$
miot aws-iot-setup --port /dev/ttyUSB0 --aws-region eu-west-1 --aws-iot-policy thing1-Policy && miot console --port /dev/ttyUSB0
AWS region: eu-west-1
Connecting to the device...
Current MQTT config: {
"clean_session": true,
"keep_alive": 60,
"pub": "/response",
"reconnect_timeout_max": 60,
"reconnect_timeout_min": 10,
"server": "broker.mqttdashboard.com:1883",
"ssl_ca_cert": "",
"ssl_cert": "",
"ssl_key": "",
"sub": "/request",
"will_message": "",
"will_topic": ""
}
Generating certificate request, CN: miot-AEEPPUGGKE4RC1E6
Generating private key locally
Asking AWS for a certificate...
Certificate ID: 83f6be2d16f0e1849e07b3cd922d2fc0748439704715bfa13c65bbddcfa23b9e
Certificate ARN: arn:aws:iot:eu-west-1:493820262597:cert/83f6be2d16f0e1849e07b3cd922d2fc0748439704715bfa13c65bbddcfa23b9e
Wrote private key to aws-iot-83f6be2d16.key.pem
Wrote certificate to aws-iot-83f6be2d16.crt.pem
Attaching policy "thing1-Policy" to the certificate...
Uploading certificate...
Uploading key...
Uploading CA certificate...
New config: {
"clean_session": true,
"keep_alive": 60,
"pub": "/response",
"reconnect_timeout_max": 60,
"reconnect_timeout_min": 10,
"server": "a1pjwh2bop1ojt.iot.eu-west-1.amazonaws.com:8883",
"ssl_ca_cert": "ca-verisign-ecc-g2.crt.pem",
"ssl_cert": "aws-iot-83f6be2d16.crt.pem",
"ssl_key": "aws-iot-83f6be2d16.key.pem",
"sub": "/request",
"will_message": "",
"will_topic": ""
}
Setting new configuration...
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57
...
miot_wifi_setup_sta WiFi STA: Connecting to Cesanta
miot_sys_config_init_http HTTP server started on [80]
mg_rpc_channel_mqtt 0x3ffcfeb8 test/rpc
mg_rpc_channel_uart 0x3ffcff64 UART0
miot_i2c_create I2C initialized (SDA: 22, SCL: 23)
miot_init Init done, RAM: 163040 free, 163040 min free
I (3784) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1
I (4364) wifi: state: init -> auth (b0)
I (4364) wifi: state: auth -> assoc (0)
I (4364) wifi: state: assoc -> run (10)
I (4384) wifi: connected with Cesanta, channel 11
miot_wifi_on_change_cb Wifi: connected
I (7664) event: ip: 192.168.1.31, mask: 255.255.255.0, gw: 192.168.1.1
miot_wifi_on_change_cb WiFi: ready, IP 192.168.1.31
mqtt_global_connect MQTT connecting to a1pjwh2bop1ojt.iot.eu-west-1.amazonaws.com:8883
mongoose_poll New heap free LWM: 156524
mongoose_poll New heap free LWM: 154004
SW ECDSA verify curve 3 hash_len 32 sig_len 72
SW ECDSA verify curve 3 hash_len 32 sig_len 71
ATCA is not available (-20096), using sw ECDH
mongoose_poll New heap free LWM: 142856
ev_handler MQTT Connect (1)
ev_handler CONNACK: 0
sub Subscribed to /request