Weird output from serial port

Hello,

In short, my use case is that I'm trying to onboard a Thingy:91 to AWS IoT Core through the available code sample following this tutorial (and the related library description linked in it).

What I did successfully was: 

  1. I managed to provision the certificates to the device (I can see them listed along with the default ones with the AT%CMNG=1 command).
  2. I created a project from the sample (aws_iot), edited the required properties (AWS MQTT endpoint, device_id, topics, ...) and managed to build it in VSCode for the thingy91_nrf9160_ns target.
  3. I flashed the resulting app_signed.hex file on the device with the Programmer application (it took ~50 seconds).

However, on rebooting the device in regular mode I get nothing in AWS IoT Core - nothing in the topics, nothing for the shadow.

I tried to get some clues from the serial terminal but all I get is a blank, black terminal. (Interestingly executing commands in the LTE Link Monitor is successful ...)

I tried to play a bit with the ports and their options but the only visible result was on the second (not the default for any of the previously (successfully) executed operations) port and it looked like the wrong Baud Rats was given:

Any ideas on how to proceed and how to determine what might be wrong? I've followed the tutorials as closely as possible, yet we're here.

Best regards,

Ivan Popov

  • A follow up, or an update to my situation:

    The default aws_iot sample actually works because in the MQTT Client in AWS IoT Core when I hit publish to one of the default topics I receive responses from the device ... (now all I have to do is to rework it to send the telemetry from the ambient sensors to a custom topic). 

    All of the further development seems to have to be done kind of in the dark. That is because there is still nothing on the serial port. I tried to record a trace in the Cellular Monitor but the UART indicator (this one might be in the LTE Link Monitor actually) at the top only blinks between yellow and red and the trace files written n the file system are always empty:

    Also the J-Link RTT Viewer can't connect with the default options:


    If this would be of any assistance here are the values from the System Report (done by the LTE Link Monitor too):

    # nRFConnect System Report - 2023-09-26T07-51-38.282Z

    - System: Dell Inc. Latitude 5501
    - BIOS: Dell Inc. 1.11.1
    - CPU: 1 x Intel CoreTm i7-9850H 2.6 GHz 12 cores (6 physical)
    - Memory: 5 GB free of 31.1 GB total
    - Filesystem: /dev/nvme0n1p2 (ext4) 95.9 GB 80.4% used

    - OS: LinuxMint (5) linux x64

    - Versions
    - kernel: 5.10.0-25-amd64
    - git: 2.30.2
    - node: 16.17.1
    - python: 3.9.2
    - python3: 3.9.2
    - nrf-device-lib-js: 0.6.12
    - nrf-device-lib: 0.15.3
    - nrfjprog DLL: 10.19.1
    - JLink: JLink_V7.80c

    - Connected devices:
    - THINGY91_EFF429E9883D : /dev/ttyACM0, /dev/ttyACM1

    If any additional information is needed, please let me know.

    Regards,

    Ivan Popov

  • Hello,

    Any ideas on how to proceed and how to determine what might be wrong?

    It says the dev/ttyAMC0 port is open in another window. Have you checked this?

    Ivan Popov said:
    The default aws_iot sample actually works because in the MQTT Client in AWS IoT Core when I hit publish to one of the default topics I receive responses from the device ...

    Do you receive serial output from this sample?

    Ivan Popov said:
    Also the J-Link RTT Viewer can't connect with the default options:

    Did you configure RTT as uart backend?

  • Hi,

    Sorry for the late answer but I got dragged in another project for a while.

    It says the dev/ttyAMC0 port is open in another window. Have you checked this?

    Yes, I might have overlooked and forgot about this during taking the screenshot.

    Do you receive serial output from this sample?

    Later with all other windows closed and nothing else taking up the port I was watching the Serial terminal waiting to see output resembling the one shown here but nothing. 
    In AWS IoT Core's MQTT Client I can still initiate pub/sub communication but I'm still seeing none of it in a terminal session.

    Did you configure RTT as uart backend?

    I didn't know it requires it's own preliminary configuration - where should I look for this one?

  • Hi,

     

    My apologies for the delayed response.

     

    Q1: Are you able to run any other sample and get uart output? If you try hello_world for instance.

    Q2: Can you share your dmesg output after connecting the thingy91?

    Ivan Popov said:
    I didn't know it requires it's own preliminary configuration - where should I look for this one?

    If you haven't actively added any RTT prints, you shouldn't need to use it. Ie. the default is to output on UART with the aws_iot sample.

     

    As you're using mint - Could it be that brltty is grabbing the other ttyACM device?

    https://askubuntu.com/questions/1454633/dev-ttyusb0-device-connects-then-is-forced-to-disconnect-by-another-device

     

    Kind regards,

    Håkon

  • Hi,

    No need to apologise - you just got assigned to the ticket.

    On your first question: at first I tried with the Blinky example as shown in this video. I honestly don't remember if I ever needed to watch the output in a console, since the case is too simple and the Thingy blinked without any issues. I might try a hello_world style example or something involving console output specifically but due to my schedule I can try it tomorrow, earliest.

    Here is the whole dmesg output after I connect the Thingy to the computer:

    And here is output in the Serial Terminal (from the file) (the aws_iot sample is flashed on the device):

    As for the brltty problem - I've had it before with another device (as you can see from my answer here), and I've removed it some time ago.


    Now since my situation changed:

    • device is visible in AWS, so I assume the sample works and the communication can be maintained through MQTT;
    • from that perspective what I really need is the Asset Tracker v2 sample modified according my case;
    • the build for the sample fails with the only change to it being the addition of the AWS properties in the respective overlay file (overlay-aws.conf) and the error is addressed in this ticket too:

    ... and since the problem is already different from the one in the title of the ticket, I'm not very sure if I have to close this and open another one, or we just can finish this here?

    Best regards,

    Ivan Popov

Related