NordicPlayground / nRF51-ble-bcast-mesh

Other
323 stars 121 forks source link

Serial communication issue. #96

Closed lopeznegrete closed 8 years ago

lopeznegrete commented 8 years ago

I am trying to follow this guide from the devzone:

https://devzone.nordicsemi.com/blogs/672/accessing-the-ble-mesh-via-the-spark-cloud/

I want to connect a photon device from particle.io to a 10028 board (v1.1.0). I have connected both devices as indicated on the devzone guide:

Line: Particle -> nRF

Power: 3V3-> VDD Ground: GND -> GND Reset: D2 -> RESET REQN: A2 -> P0.24 RDYN: D5 -> P0.20 SCK: A3 -> P0.29 MISO: A4 -> P0.28 MOSI: A5 -> P0.25

Bridge the solder bridge SB17 on the nRF51-DK

I have also connected the SB17 bridge. It seems to me that the ble-mesh-cloud.ino on the particle.io platform is basically the same example under application_controller/serial_interface/serial_interface.ino with some defs names changed.

I have used a serial connection to the photon devices in order to try to debug what is the issue and I have the following error:

Initalization Done Sent init command Error response on cmd 70: 84 Enabled value 1 Error response on cmd 72: 84 Enabled value 2 Error response on cmd 72: 84 init done

My understanding is that ACI error 84 is related to an invalid length (ACI_STATUS_ERROR_INVALID_LENGTH). I am not sure if this could be cause by a miscommunication between both devices. I have checked the SPI connection several times.

UPDATE 26/04

It seems that the problem is a mismatch between the lengths. On the lines 118 and on the mesh_aci.c file:

Line 118: if (serial_cmd->length != sizeof(serial_cmd_params_init_t) + 1)

        where:
        serial_cmd->length = 11
        sizeof(serial_cmd_params_init_t) + 1 = 10

Line 244: if (serial_cmd->length != sizeof(serial_cmd_params_value_disable_t) + 1)

        where:
        serial_cmd->length = 2
        sizeof(serial_cmd_params_value_disable_t) + 1 = 3

I am starting to suspect that there are some differences between the NRF8001-BLE-UART-SPARK-IO library at particle.io platform and the application_controller/serial_interface/serial_interface.ino files.

Any hint would be most welcome

lopeznegrete commented 8 years ago

It seems that the nrf8001-ble-uart-spark-io code at particle.io is outdated. There is a new development by Erin, although it need to be revamped.

https://github.com/erinsb/nrf8001-ble-uart-spark-io