renesas-rx / amazon-freertos

A fork/prototype of the Amazon FreeRTOS to support Renesas RX MCUs. Please refer to our wiki for more details.
https://github.com/renesas-rx/amazon-freertos/wiki
MIT License
7 stars 6 forks source link

aws_hello_world.c demo is not working on eabe25f5a44d658ae7e8bb21e26d1dc9fc5df0bf for rx65n-rsk #1

Closed sarenameas closed 5 years ago

sarenameas commented 5 years ago

Describe the bug The hello world demo does not work on the tip of master (eabe25f5a44d658ae7e8bb21e26d1dc9fc5df0bf) for the rx65n-rsk.

To Reproduce Steps to reproduce the behavior:

  1. Create a thing in the AWS IoT core with the permissions on the certificate:
    {
    "Version": "2012-10-17",
    "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "iot:*",
        "greengrass:*"
      ],
      "Resource": "*"
    }
    ]
    }
  2. Set aws_clientcredential.h for clientcredentialMQTT_BROKER_ENDPOINT and clientcredentialIOT_THING_NAME.
  3. Set aws_clientcredential_keys.h for keyCLIENT_CERTIFICATE_PEM and keyCLIENT_PRIVATE_KEY_PEM.
  4. Run the hello world demo.
    
    /* Demo declarations. */
    /* extern void vStartDeviceDefenderDemo( void ); */
    /* extern void vStartGreenGrassDiscoveryTask( void ); */
    extern void vStartMQTTEchoDemo( void );
    /* extern void vStartOTAUpdateDemoTask( void ); */
    /* extern void vStartShadowDemoTasks( void ); */
    /* extern void vStartSimpleTCPServerTasks( void ); */
    /* extern void vStartSubpubDemoTasks( void ); */
    /* extern void vStartTCPEchoClientTasks_SeparateTasks( void ); */
    /* extern void vStartTCPEchoClientTasks_SingleTasks( void ); */

/-----------------------------------------------------------/

/**


**Expected behavior**
We expect 0 through 11 successful publishes and acknowledgements.
As far as I know the demo works in 765992a76f2c57724dabe4c8cc472a7ca1d5c651.

**Screenshots**

Hello World. 0 2 [Tmr Svc] Write code signing certificate... 1 5 [Tmr Svc] Write device private key... 2 114 [Tmr Svc] Key provisioning done... 3 114 [Tmr Svc] Creating MQTT Echo Task... 4 114 [IP-task] prvIPTask started 5 5702 [IP-task] prvInitialiseDHCP: start after 250 ticks 6 5702 [IP-task] vDHCPProcess: discover 7 10703 [IP-task] vDHCPProcess: discover 8 10703 [IP-task] vDHCPProcess: timeout 10000 ticks 9 10733 [IP-task] vDHCPProcess: offer a3cd65fip 10 10733 [IP-task] vDHCPProcess: reply a3cd65fip 11 10763 [IP-task] vDHCPProcess: offer a3cd65fip 12 10763 [IP-task] vDHCPProcess: acked a3cd65fip 13 10764 [IP-task] IP Address: 10.60.214.95 14 10764 [IP-task] Subnet Mask: 255.255.252.0 15 10764 [IP-task] Gateway Address: 10.60.212.1 16 10764 [IP-task] DNS Server Address: 10.43.23.72 17 15704 [MQTTEcho] MQTT echo attempting to connect to xxx.iot.us-west-2.amazonaws.com. 18 15704 [MQTTEcho] Sending command to MQTT task. 19 15704 [MQTT] Received message 10000 from queue. 20 15728 [MQTT] prvProcessDNSCache: add: 'xxx.iot.us-west-2.amazonaws.com' @ 342391a1ip 21 15728 [IP-task] Socket sending wakeup to MQTT task. 22 15728 [MQTT] FreeRTOS_connect: 29852 to 342391a1ip:8883 23 15728 [MQTT] Socket 29852 -> 342391a1ip:8883 State eCLOSED->eCONNECT_SYN 24 15729 [IP-task] prvSocketSetMSS: 1400 bytes for 342391a1ip:8883 25 15729 [IP-task] Connect[342391a1ip:8883]: next timeout 1: 3000 ms 26 15740 [IP-task] MSS change 1400 -> 1380 27 15740 [IP-task] Change mss 1400 => 1380 28 15740 [IP-task] Socket 29852 -> 342391a1ip:8883 State eCONNECT_SYN->eESTABLISHED 29 15868 [IP-task] MSS: sending 1380 30 21131 [MQTT] Anonymous metrics will be collected. Recompile withmqttconfigENABLE_METRICS set to 0 to disable. 31 21131 [MQTT] Received message 0 from queue. 32 21175 [IP-task] Socket sending wakeup to MQTT task. 33 21175 [MQTT] Received message 0 from queue. 34 21175 [MQTT] Received fixed header, 2 bytes to receive. 35 21175 [MQTT] CONNACK received. 36 21175 [MQTT] MQTT Connect was accepted. Connection established. 37 21175 [MQTT] Notifying task. 38 21176 [MQTTEcho] Command sent to MQTT task passed. 39 21176 [MQTTEcho] MQTT echo connected. 40 21176 [MQTTEcho] MQTT echo test echoing task created. 41 21176 [MQTTEcho] Sending command to MQTT task. 42 21176 [MQTT] Received message 20000 from queue. 43 21176 [MQTT] Initiating MQTT subscribe. 44 21203 [IP-task] Socket sending wakeup to MQTT task. 45 21204 [MQTT] Received message 0 from queue. 46 21204 [MQTT] Received fixed header, 3 bytes to receive. 47 21204 [MQTT] MQTT Subscribe was accepted. Subscribed. 48 21204 [MQTT] Notifying task. 49 21204 [MQTTEcho] Command sent to MQTT task passed. 50 21204 [MQTTEcho] MQTT Echo demo subscribed to freertos/demos/echo 51 21204 [MQTTEcho] Sending command to MQTT task. 52 21204 [MQTT] Received message 30000 from queue. 54 21250 [IP-task] Socket sending wakeup to MQTT task. 55 21250 [MQTT] Received message 0 from queue. 56 21250 [MQTT] Received fixed header, 2 bytes to receive. 57 21250 [MQTT] MQTT Publish was successful. 58 21250 [MQTT] Notifying task. 59 21251 [MQTTEcho] Command sent to MQTT task passed. 60 21251 [MQTTEcho] Echo successfully published 'Hello World 0' 61 21302 [IP-task] Socket sending wakeup to MQTT task. 62 21302 [MQTT] Received message 0 from queue. 63 21303 [MQTT] Received fixed header, 36 bytes to receive. 64 21303 [Echoing] Sending command to MQTT task. 65 21303 [MQTT] Received message 40000 from queue. 66 21303 [MQTT] Initiating MQTT publish. 67 21366 [IP-task] Socket sending wakeup to MQTT task. 68 21366 [MQTT] Received message 0 from queue. 69 22377 [IP-task] Socket sending wakeup to MQTT task. 70 22377 [MQTT] Received message 0 from queue. 71 22389 [IP-task] Socket sending wakeup to MQTT task. 72 22389 [MQTT] Received message 0 from queue. 73 22390 [MQTT] Received fixed header, 2 bytes to receive. 74 22390 [MQTT] MQTT Publish was successful. 75 22390 [MQTT] Notifying task. 76 22391 [Echoing] Command sent to MQTT task passed. 77 22391 [Echoing] Message returned with ACK: 'Hello World 0 ACK' 78 22434 [IP-task] Socket sending wakeup to MQTT task. 79 22434 [MQTT] Received message 0 from queue. 80 22434 [MQTT] Received fixed header, 40 bytes to receive. 81 22501 [IP-task] Socket sending wakeup to MQTT task. 82 22501 [MQTT] Received message 0 from queue. 83 26251 [MQTTEcho] Sending command to MQTT task. 84 26251 [MQTT] Received message 50000 from queue. 85 26251 [MQTT] Initiating MQTT publish. 86 26261 [IP-task] Socket sending wakeup to MQTT task. 87 26261 [MQTT] Received message 0 from queue. 88 26375 [IP-task] Socket sending wakeup to MQTT task. 89 26376 [MQTT] Received message 0 from queue. 90 26376 [MQTT] Received fixed header, 2 bytes to receive. 91 26376 [MQTT] MQTT Publish was successful. 92 26376 [MQTT] Notifying task. 93 26377 [MQTTEcho] Command sent to MQTT task passed. 94 26377 [MQTTEcho] Echo successfully published 'Hello World 1' 95 26434 [IP-task] Socket sending wakeup to MQTT task. 96 26435 [MQTT] Received message 0 from queue. 97 26435 [MQTT] Received fixed header, 36 bytes to receive. 98 26436 [Echoing] Sending command to MQTT task. 99 26436 [MQTT] Received message 60000 from queue. 100 26436 [MQTT] Initiating MQTT publish. 101 26445 [IP-task] Socket sending wakeup to MQTT task. 102 26446 [MQTT] Received message 0 from queue. 103 27455 [IP-task] Socket sending wakeup to MQTT task. 104 27455 [MQTT] Received message 0 from queue. 105 27465 [IP-task] Socket sending wakeup to MQTT task. 106 27465 [MQTT] Received message 0 from queue. 107 27466 [MQTT] Received fixed header, 2 bytes to receive. 108 27466 [MQTT] MQTT Publish was successful. 109 27466 [MQTT] Notifying task. 110 27467 [Echoing] Command sent to MQTT task passed. 111 27467 [Echoing] Message returned with ACK: 'Hello World 1 ACK' 112 27511 [IP-task] Socket sending wakeup to MQTT task. 113 27511 [MQTT] Received message 0 from queue. 114 27511 [MQTT] Received fixed header, 40 bytes to receive. 115 27576 [IP-task] Socket sending wakeup to MQTT task. 116 27577 [MQTT] Received message 0 from queue. 117 31377 [MQTTEcho] Sending command to MQTT task. 118 31377 [MQTT] Received message 70000 from queue. 119 31377 [MQTT] Initiating MQTT publish. 120 31387 [IP-task] Socket sending wakeup to MQTT task. 121 31387 [MQTT] Received message 0 from queue. 122 33877 [MQTT] MQTT Timeout. 123 33877 [MQTT] Notifying task. 124 33878 [MQTTEcho] Command sent to MQTT task failed. 125 33878 [MQTTEcho] ERROR: Echo failed to publish 'Hello World 2' 126 38878 [MQTTEcho] Sending command to MQTT task. 127 38878 [MQTT] Received message 80000 from queue. 128 38878 [MQTT] Initiating MQTT publish. 129 41378 [MQTT] MQTT Timeout. 130 41378 [MQTT] Notifying task. 131 41379 [MQTTEcho] Command sent to MQTT task failed. 132 41379 [MQTTEcho] ERROR: Echo failed to publish 'Hello World 3' 133 41887 [IP-task] TCP: RST received from 342391a1ip:8883 for 29852 134 41887 [IP-task] Socket 29852 -> 342391a1ip:8883 State eESTABLISHED->eCLOSED 135 41887 [IP-task] Socket sending wakeup to MQTT task. 136 41887 [MQTT] Received message 0 from queue. 137 41888 [MQTT] About to close socket. 138 41888 [IP-task] FreeRTOS_closesocket[29852 to 342391a1ip:8883]: buffers 1 socks 0 139 41888 [MQTT] Socket closed. 140 41888 [MQTT] Stack high watermark for MQTT task: 1314 141 46379 [MQTTEcho] Sending command to MQTT task. 142 46379 [MQTT] Received message 90000 from queue. 143 46379 [MQTT] Initiating MQTT publish. 144 46379 [MQTT] MQTT_Publish failed! 145 46379 [MQTT] Notifying task. 146 46380 [MQTTEcho] Command sent to MQTT task failed. 147 46380 [MQTTEcho] ERROR: Echo failed to publish 'Hello World 4' 148 51380 [MQTTEcho] Sending command to MQTT task. 149 51380 [MQTT] Received message a0000 from queue. 150 51380 [MQTT] Initiating MQTT publish. 151 51380 [MQTT] MQTT_Publish failed! 152 51380 [MQTT] Notifying task. 153 51381 [MQTTEcho] Command sent to MQTT task failed. 154 51381 [MQTTEcho] ERROR: Echo failed to publish 'Hello World 5' 155 56381 [MQTTEcho] Sending command to MQTT task. 156 56381 [MQTT] Received message b0000 from queue. 157 56381 [MQTT] Initiating MQTT publish. 158 56381 [MQTT] MQTT_Publish failed! 159 56381 [MQTT] Notifying task. 160 56382 [MQTTEcho] Command sent to MQTT task failed. 161 56382 [MQTTEcho] ERROR: Echo failed to publish 'Hello World 6' 162 61382 [MQTTEcho] Sending command to MQTT task. 163 61382 [MQTT] Received message c0000 from queue. 164 61382 [MQTT] Initiating MQTT publish. 165 61382 [MQTT] MQTT_Publish failed! 166 61382 [MQTT] Notifying task. 167 61383 [MQTTEcho] Command sent to MQTT task failed. 168 61383 [MQTTEcho] ERROR: Echo failed to publish 'Hello World 7' 169 66383 [MQTTEcho] Sending command to MQTT task. 170 66383 [MQTT] Received message d0000 from queue. 171 66383 [MQTT] Initiating MQTT publish. 172 66383 [MQTT] MQTT_Publish failed! 173 66383 [MQTT] Notifying task. 174 66384 [MQTTEcho] Command sent to MQTT task failed. 175 66384 [MQTTEcho] ERROR: Echo failed to publish 'Hello World 8' 176 71384 [MQTTEcho] Sending command to MQTT task. 177 71384 [MQTT] Received message e0000 from queue. 178 71384 [MQTT] Initiating MQTT publish. 179 71384 [MQTT] MQTT_Publish failed! 180 71384 [MQTT] Notifying task. 181 71385 [MQTTEcho] Command sent to MQTT task failed. 182 71385 [MQTTEcho] ERROR: Echo failed to publish 'Hello World 9' 183 76385 [MQTTEcho] Sending command to MQTT task. 184 76385 [MQTT] Received message f0000 from queue. 185 76385 [MQTT] Initiating MQTT publish. 186 76385 [MQTT] MQTT_Publish failed! 187 76385 [MQTT] Notifying task. 188 76386 [MQTTEcho] Command sent to MQTT task failed. 189 76386 [MQTTEcho] ERROR: Echo failed to publish 'Hello World 10' 190 81386 [MQTTEcho] Sending command to MQTT task. 191 81386 [MQTT] Received message 100000 from queue. 192 81386 [MQTT] Initiating MQTT publish. 193 81386 [MQTT] MQTT_Publish failed! 194 81386 [MQTT] Notifying task. 195 81387 [MQTTEcho] Command sent to MQTT task failed. 196 81387 [MQTTEcho] ERROR: Echo failed to publish 'Hello World 11' 197 86387 [MQTTEcho] Sending command to MQTT task. 198 86387 [MQTT] Received message 110000 from queue. 199 86387 [MQTT] Notifying task. 200 86388 [MQTTEcho] Command sent to MQTT task passed. 201 86388 [MQTTEcho] MQTT echo demo finished. 202 86388 [MQTTEcho] ----Demo finished----


**Desktop (please complete the following information):**
 - OS: Windows 10
 - Browser Chrome
 - Version n/a

**Additional context**
Please test all of the new changes.
HirokiIshiguro commented 5 years ago

Thank you for the comment. I will confirm this issue in next weekend. And I will fix. Yes, now I am trying all the tests.

HirokiIshiguro commented 5 years ago

Ah, I cannot confirm this behavior by using eabe25f5a44d658ae7e8bb21e26d1dc9fc5df0bf. Do you have IC socket type of RX65N RSK board, if so, please push IC socket in vertically? I guess IC socket may not connect each MCU pins.

sarenameas commented 5 years ago

Using d3549828814daa38078492c3c879cdc0d6118ced things seem to have sorted themselves out. This was probably transient. Thank you for looking into it. I will close this. Thanks.

HirokiIshiguro commented 5 years ago

Yes, thank you very much.