This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

coap server with i2c

hi there! i'm struggling with the problem about using i2c with IoT SDK.

my project is about transferring sensor data (i2c) through ipv6 over ble , so i used the IoT softdevice s1xx-iot-prototype2_softdevice.hex.

i tried to combine my mbed i2c code (exported) with IoT example CoAP Server, but i'm confused and wondered about that it is possible or not.

and i have another question. Is i2c (sdr,scl) programming available over the IoT softdevice with the CoAP server example source?? and can we check the value through uart?

please help me!

  • It should not be a problem to sample data on the TWI (I2C) and send this data over CoAP.

    Take a look at the example in iot/cloud/coap/data_source, here sensor data is sent in given intervals over CoAP. The data to be sent is prepared in coap_request_send(). In the example the sensor data is just stored in an array in m_data_points, but you can easily substitute this with data sampled over TWI.

    I'm not sure how it is to combine your I2C mbed code with the IoT code, but if you take a look at the nRF5 SDK, you can find examples there on how to initialize the TWI and how to sample data. Just copy this code over to the IoT example, and then in the coap_request_send() you can call the function to read data over TWI.

  • hello stian I want to do the things as same as GNoB in this example ( \nrf51\examples\iot\coap\ipv6\server) so do I need to use your sugggestion which you mention in second paragraph (some function in cloud example) to my example ( \nrf51\examples\iot\coap\ipv6\server) ? By the way,do you have some DEMO codes about CoAP server with others sensors? Thanks!!!

  • HI , GNoB is the way coap server with i2c works with you ??

    I just combines the CoAP server with the humidity example separately, and I also don't know how to transfer the sensing data into CoAP packets.

    but I know that we can make it by just designing CoAP packets!

    thanks!!

Related