Other Parts Discussed in Thread: CC2652R7
Tool/software:
SDK: simplelink_cc13xx_cc26xx_sdk_6_41_00_17
Sample program: temp_sensor_LP_CC2652R7_tirtos7_ticlang
Background:
The host and the border router are on the same wifi, the temperature sensor is connected to the border router, and the Espressif coap_server is established on the border router to receive the value sent by the temperature sensor
Question:
Why can't the coap post in the temperature sensor example be sent to the Espressif coap_server example server?
Trial process:
I tried ff02::1 and the server's IPV6 address as the sending address, but I didn't get any feedback from the coap server.
I wrote a program on the host using the aiocoap library to get the value in the temperature sensor, and it succeeded (using the IPV6 address of the temperature sensor). I also tried to use get to get the value of the coap_server on the border router and use post to push the value, which also succeeded. But I don't know why the coap in the temperature sensor cannot be sent to the server in the border router
This is the python code I wrote:
import logging import asyncio import time from aiocoap import * # logging.basicConfig(level=logging.INFO) count = 0 async def main(): global count sensor_address = "fd01:2c48:84a3:1:ef0f:45ea:99dc:ca90" resource_path = "/tempsensor/temperature" protocol1 = await Context.create_client_context() request = Message(code=GET, uri=f"coap://[{sensor_address}]{resource_path}") try: response = await protocol1.request(request).response except Exception as e: print("Failed...") # print(e) else: print("%d: %r" % (count, response.payload)) count += 1 if __name__ == "__main__": while 1: time.sleep(1) asyncio.run(main())