First experience with IoT by Infineon Technologies AIROC™ CCM Evaluation Kit

Table of contents

RoadTest: Enroll to Review the Infineon AIROC™ Cloud Connectivity Manager Eval Kit

Author: Galloth

Creation date:

Evaluation Type: Development Boards & Tools

Did you receive all parts the manufacturer stated would be included in the package?: True

What other parts do you consider comparable to this product?: N/A

What were the biggest problems encountered?: My biggest issues with this product is that I was able to achieve only slow connectivity between AWS and the CCM. Moreover I was unable to detect missing event in the trasmission.

Detailed Review:

Motivation

I decided to participate in the roadtest of the AIROC CCM evaluation kit because I wanted to gain my first experiences in the area of Internet of Things (IoT) and outsourcing the computation to the AWS cloud. 

The topic of IoT is not new but until recently it did not catch my interest. However, with the advent of artificial intelligence, the possibilities of the device connected to the cloud seems to be infinite. We often hear about the robotic factories monitored and controlled from the cloud over the internet. I must admit, that I was hyped up with the advertisements about the CCM showing the robots, drones, etc. Therefore I was interested in the actual possibilities and limitations of such a solution and this roadtest offered me the way to discover exactly that. My original plan was to use this CCM to connect RC car with the AWS cloud system to use the cloud to provide more advanced driving algorithms for the car, such as obstacle detection or the route planning.

IFW956810 description

The IFW956810 is the cloud connection manager development kit. It contains the IFW56810 Cloud connection manager (CCM) together with the FTDI chip for connection between host PC and the CCM.  The connection between the FTDI chip and the CCM is realized by the set of jumpers as shown on the following figure.

AIROC CCM DevKit

This solution allows easy switching between different evaluation modes. At first I evaluated the CCM through the python program running on the host PC and later I moved my experiments into the MCU with the hopes to obtain more realistic results. The photo shows the jumpers in the starting position. The DevKit can be connected directly to the PC over the USB-C port. The adapter between USB-A and the USB-C ports is part of the package. 

The basic documentation for the SW working with the CCM is available online and is comprehensive enough for the first experiments with the device. The online documentation describes basic AT commands used to send/receive messages as well as how to set up the AWS cloud account to communicate with the DevKit. After a few minutes of online searches, I was able to find a list of AT Commands supported by the CCM as well as an Getting Started document. However, I was never able to find comprehensible documentation describing  all supported AT commands or the architecture of the CCM itself. 

Python experiments

For my experiments I used a Windows 10 PC. When the IFW956810gets connected over the USB, two new Serial ports appear in the device manager. In my case, the CCM was consistently connected to the second one. (Specifically COM6 on my computer). We can use putty or any other terminal software to connect to this port and send AT commands to verify that connection is working.

Instead of using the terminal, I used python and the pyserial library to facilitate the communication with the CCM. To connect with CCM, I used the following function

def connect(portName):
   logger.debug("Preparing to access UART")
   try:
      ser = serial.Serial(portName, 115200, timeout=60, parity=serial.PARITY_NONE, rtscts=0)
   except serial.SerialException as err:
      logger.exception("Serial Exception")
      exit(UART_NOT_FOUND)
   logger.debug("Opened UART: %s"%str(ser))
   return ser

The configuration for the serial connection is copied from the User guide and worked on the first try. The CCM supports an ID function to allow it identification over the serial connection. When the AT command  AT+CONF? About\n is received, the CCM answers with the string OK Infineon - IFW56810\r\n to confirm its identity. The first experiment I attempted with the CCM was to evaluate the speed and the quality of the communication channel between the CCM and the host PC by requesting identification immediately one after another. The sent AT commands have length of 15 bytes and the expected response has length of 24 bytes. The time module in python allows me to measure the current time. I use a time module to measure how long it takes to send 100 ID requests together with its answer.

def measureResponseSpeed(portObject,testLen=100):
   start = time.time()
   for idx in range(0,testLen):
      if not checkID(portObject): print("FAIL")
   end = time.time()
   testTime = end-start
   testPayloadLen = testLen*(15+24)
   testThroughput = (testPayloadLen/testTime)
   logger.debug("Serial link throughput is %f bytes per second"%testThroughput)
   return testThroughput
The number of the request multiplied by the request and answer length is the number of bytes transferred during the test (testPayloadLen). This value is then divided by the time spend performing the test. The expectation was that since the generating the response string should be very easy, the UART communication will be the main source of delay. Moreover, after every ID request, the script waits for the response before generating following request. Therefore, even if the UART support bidirectional communication, the test itself always transfer only in one direction. The UART was configured to have speed of 115200 bauds which means that the measured throughput should be around the 14KB per second. Unfortunately, the measured throughput was only 500 bytes per second. 
To perform any other experiments, the CCM needs to be connected to the internet over WiFI network. The whole communication can be done by the sequence of the AT commands. 
AT+CONF SSID=
AT+CONF Passphrase=
AT+CONNECT\n
AT+DIAG PING 8.8.8.8\n
AT+CLOUD_SYNC\n
AT+CONF? Endpoint\n

From the listed AT commands, only the first three are strictly necessary. The first set the SSID for the WIFI which will be used for the communication with the cloud while the second configures the passphrase for the network. The AT+CONNECT command is described as a command to connect the CCM with the AWS cloud but in my experiments, it was required to connect to the internet after the WIFI credentials changed. I use the AT+DIAG PING 8.8.8.8\n to verify that the internet connection is available.  When the CCM receives these commands, it attempts to send the PING towards the specified IP address (google DNS server) and shows the latency as a response. The last command AT+CONF? Endpoint\n just prints the endpoint (specific location in the AWS) to which CCM connects. This information is important when configuring the AWS cloud since if the endpoint in CCM is different from the cloud instance used to run the AWS, the CCM will not connect. This configuration needs to be rerun every time when the WIFI credentials changes but it will remain stored in the non-volatile memory in the CCM. 

When the WIFI and Internet connection becomes available, the AWS cloud must be configured to communicate with the CCM. There are several versions of the configuration guide on the internet. The part of the support provided by Infineon to the IFW956810 users is the CIRRENT flow, which can be used to configure the AWS cloud in a few steps. When the configuration is successfully finished, it is possible to send and receive messages between the CCM and the AWS IoT Cloud. The AWS cloud also offers MQTT test client which can be used to send and receive messages as well.

When the device needs to send a message, it starts by configuring the channel by AT+CONF Topic1= command. The  IFW956810 allows you to configure several parallel channels. The actual message is sent by AT+SEND1 %s\n command. When the device needs to receive a message, it needs to subscribe to a specific channel by the AT+SUBSCRIBE2 command. The topic for the subscribed channel must be correctly configured in advance. Up to my knowledge, CCM does not have any method to indicate it received a message. The user is expected to call the AT+GET2\n command and parse the response. The MQTT test client may subscribe to receive messages generated by the CCM device and it can be used to generate the message with the topic to which the CCM subscribed. Therefore the MQTT test client can be used to test, if the communication between the CCM and the cloud operates correctly.

With the AWS configured, I attempted to evaluate the reaction time for processing the messages. The first experiment I performed was the loopback test. I implemented a simple lambda function to send back every received message.

def lambda_handler(event, context):
  # TODO implement

  client = boto3.client('iot-data', region_name='us-west-1')
  # Change topic, qos and payload
  print(event)
  response = client.publish(
    topic='/toDevice',
    qos=0,
    payload=json.dumps(event)
  )
  return {
    'statusCode': 200,
    'body': json.dumps('Hello from Lambda!')
  }

On the device part, I run the loopback test function, which sends the message to the AWS and waits for the response message in the /toDevice channel. When the response is received, the test compares the received data with the sent original version. According to the AWS the message size should be up to 128KB. However, the length limit for the message in this test is around 256 bytes. 

The latency of this test is very dependent on the quality of the internet connection. I used my home connection for the testing, which may be the cause of the issue, but the average latency for the 1 message loopback was sometimes up to 1.5s. 

The second test I did with the CCM was more focused on the speed of sending. I implemented a rule in the AWS to store all incoming messages into the dynamoDB. The database stores the message together with the timestamp when the message was received. Therefore it is possible to send several messages one after another and estimate the network transfer time from the difference between the first and the last timestamp. For this test, the array of different messages of specified length was generated and the transmit channel was prepared. All messages were sent immediately one after another inside the for loop. The only AT command inside the loop was AT+SEND1

The assumption of this test is that the actual latency of the network is much less than the latency of the CCM and the AWS. As long as the network latency is roughly constant, the results of this test are still relevant. During the test, 100 messages are sent. The time for the test is computed by subtracting the timestamp of the first received messages from the timestamp of the last delivered message. Since the size of the message is known, the payload of the test can be computed by 99*msgLen. The first message is not counted into the payload since it is transferred "before" the first timestamp. I tried to generate messages of a different length to see how the message length affects the behavior of the transport layer. 

Message Length Average Time per message Estimated Throughput
50 98ms 0.5KBps
200 105ms 2KBps
The interesting observation with this test is that the measured throughput for the 200bytes long message is higher than the throughput of ID check, when no internet connection was required. The measurements indicate that the time required to process the one message does not depend on the length of the message itself. This is surprising and seems to indicate that the limit of the communication is not the throughput of the connection but something else inside the CCM architecture. The second issue is that a significant amount of the messages was lost. Actually, during all of my testing, I was never able to transfer all 100 test messages. Sometimes up to 20 percent of the test messages got lost. The messages were received in random order.
The last test I performed from the host PC was focused on the receiving channel. I implemented a second lambda function in the AWS to send a predefined number of response messages for every received message. 
def lambda_handler(event, context):
  # TODO implement

  client = boto3.client('iot-data', region_name='us-west-1')
  # Change topic, qos and payload
  print(event)
  for x in range(0,int(event["messages"])):
    return_msg = {};
    return_msg["requestID"] = event["requestID"]
    return_msg["messageCnt"] = x
    return_msg["messageData"] = event["data_length"]*'A'
    response = client.publish(
       topic='/toDeviceSpeedTest',
       qos=0,
       payload=json.dumps(return_msg)
    )
  return {
    'statusCode': 200,
    'body': json.dumps('Publish messages to device')
  }
The test script will start the test by subscribing to the /toDeviceSpeedTest and sending one message to the topic connected to this lambda function. After the message is sent, the script immediately starts to generate  AT+GET2 commands until it receives the expected amount of response messages or until the predefined number of requests is generated. However this test failed to produce any usable result simply because the time required to wait at the AT+GET2 command was too long. The messages were often missed during the test but were caught during the subsequent run of the same test. On the other hand, the limit for the message length observed during the previous experiment is only for transmission from the CCM to the AWS Cloud. The 4KB messages from cloud to CCM were received in the same way as the shorter messages. 

MCU Experiments

The original plan for the RoadTest was to port the python test into some MCU. I selected the ESP32 MCU. Since the IFW956810 connects the FTDI chip and the CCM over the set of jumpers, it is very easy to switch the UART connection from the FTDI towards the MCU. I disconnected the jumpers and connected the ESP32 devkit. Unfortunately I was not able to get a reliable serial connection between the MCU and the CCM. After transferring several AT commands over the serial connection the CCM stopped reacting.

Conclusion
The IFW956810 is the nice tool for the first steps in experimenting with the AWS IoT. It is easy to install and use for sending simple messages between the device and the cloud and it allows the user to focus on the whole system instead of debugging basic IoT functionality. I believe that it is a usable product for the situation when there are very low bandwidth requirements and the resulting connection does not need to be reliable. The available documentation for the CCM does not go into the details of the architecture or even the functionality of the device. As such, it is unclear what performance should be expected from the device. Originally, I was interested in the possibility of using the cloud as part of the control loop of the system. This is obviously not intended use of the product. 

 

Anonymous
  • I think Infineon are overselling it - they talk a lot about reliability and it being a code free turn key solution. There are few applications where messages received in random order and 20% lost can be tolerated. You could work round it with your own code but my expectation was that the product was supposed to free you of that burden.

    The low bandwidth might be fine for many applications.

    MK

  • > I think we are a very long way from 'cloud in the loop' control systems.

    Definitely when using MQTT and AWS IoT. These are not intended to be part of a "deterministic(ish) loop".

    Even if the technology would allow it, the bill wouldn't Slight smile. We still need Gateway devices (and in some cases math-capable Things) to avoid reliance on IoT cloud end-to-end communication.

    > "...when there are very low bandwidth requirements and the resulting connection does not need to be reliable."

    > There can't be many applications where this restriction is acceptable. I'm hoping for some response from Infineon - they can't be content with such a poor performance.

    This is a valid use case for LoRaWan. A low budget (components and network) solution that's excellent when it fits.

    AWS offers integrations / connections with very low latency and high availability. But those aren't in the IoT area, and have a different cost.

  • Thanks for the comment. It is true that I was hoping to obeserve better bandwith but to be fair, there are a lot of applications that require only limited bandwidth. I can definitely see, that you would connect this chip to your already existing device to report some basic status. The dishwasher reporting the state of the salt or something simple like that.

  • Excellent review - thanks.

    Or perhaps I should say, excellent review, shame about the product.

    You put it very politely:

    "...when there are very low bandwidth requirements and the resulting connection does not need to be reliable."

    There can't be many applications where this restriction is acceptable. I'm hoping for some response from Infineon - they can't be content with such a poor performance.

    I think we are a very long way from 'cloud in the loop' control systems.

    MK