makerdiary / nrf52840-mdk

An Open-Source, Micro Development Kit for IoT Applications using the nRF52840 SoC
https://wiki.makerdiary.com/nrf52840-mdk/
171 stars 42 forks source link

how to configure wpantund ? #17

Open Yug11 opened 5 years ago

Yug11 commented 5 years ago

I am implementing the openthread on makerdiary's nRF52840-MDK using a Linux machine. It goes fine up to flashing the board. After that, the step where we have to configure wpantund, it constantly shows an error and it remains uninitialized. Help me resolve this issue .

caizelin commented 5 years ago

I am implementing the openthread on makerdiary's nRF52840-MDK using a Linux machine. It goes fine up to flashing the board. After that, the step where we have to configure wpantund, it constantly shows an error and it remains uninitialized. Help me resolve this issue .

@Yug11 You can follow this tutorial: https://wiki.makerdiary.com/nrf52840-mdk/openthread/#configure-wpantund

Yug11 commented 5 years ago

@caizelin I have been following the same tutorial but it is not working as at this step the terminal keeps on and nothing happens Screenshot from 2019-03-25 12-16-05

sometimes it shows unable to open the socket and sometimes descriptor in a bad state

caizelin commented 5 years ago

Make sure which serial port name you are using. It seems that /dev/ttyACH0 does not exist.

Yug11 commented 5 years ago

but it does exist Screenshot from 2019-03-25 12-37-17

caizelin commented 5 years ago

but it does exist Screenshot from 2019-03-25 12-37-17

Yes. But I saw you were using ttyACH0 not ttyACM0. Did you try ttyACM0 or ttyACM1?

caizelin commented 5 years ago

ttyACM0

Then check the UART configuration before you compile openthread. In openthread/examples/platforms/nrf52840/platform-config.h file:

/**
 * @def UART_HWFC
 *
 * UART Hardware Flow Control.
 *
 * @brief Possible values:
 *         \ref NRF_UART_HWFC_ENABLED - HW Flow control enabled.
 *         \ref NRF_UART_HWFC_DISABLED - HW Flow control disabled.
 *
 */
#ifndef UART_HWFC
#define UART_HWFC NRF_UART_HWFC_DISABLED
#endif

/**
 * @def UART_PIN_TX
 *
 * UART TX Pin.
 *
 */
#ifndef UART_PIN_TX
#define UART_PIN_TX 20
#endif

/**
 * @def UART_PIN_RX
 *
 * UART RX Pin.
 *
 */
#ifndef UART_PIN_RX
#define UART_PIN_RX 19
#endif
Yug11 commented 5 years ago

Screenshot from 2019-03-25 12-46-39

I changed it to ttyACM0 then this happens

Yug11 commented 5 years ago

ttyACM0

Then check the UART configuration before you compile openthread. In openthread/examples/platforms/nrf52840/platform-config.h file:

/**
 * @def UART_HWFC
 *
 * UART Hardware Flow Control.
 *
 * @brief Possible values:
 *         \ref NRF_UART_HWFC_ENABLED - HW Flow control enabled.
 *         \ref NRF_UART_HWFC_DISABLED - HW Flow control disabled.
 *
 */
#ifndef UART_HWFC
#define UART_HWFC NRF_UART_HWFC_DISABLED
#endif

/**
 * @def UART_PIN_TX
 *
 * UART TX Pin.
 *
 */
#ifndef UART_PIN_TX
#define UART_PIN_TX 20
#endif

/**
 * @def UART_PIN_RX
 *
 * UART RX Pin.
 *
 */
#ifndef UART_PIN_RX
#define UART_PIN_RX 19
#endif

Yes I did open this file and copied this configuration at the end

Yug11 commented 5 years ago

ttyACM0

Then check the UART configuration before you compile openthread. In openthread/examples/platforms/nrf52840/platform-config.h file:

/**
 * @def UART_HWFC
 *
 * UART Hardware Flow Control.
 *
 * @brief Possible values:
 *         \ref NRF_UART_HWFC_ENABLED - HW Flow control enabled.
 *         \ref NRF_UART_HWFC_DISABLED - HW Flow control disabled.
 *
 */
#ifndef UART_HWFC
#define UART_HWFC NRF_UART_HWFC_DISABLED
#endif

/**
 * @def UART_PIN_TX
 *
 * UART TX Pin.
 *
 */
#ifndef UART_PIN_TX
#define UART_PIN_TX 20
#endif

/**
 * @def UART_PIN_RX
 *
 * UART RX Pin.
 *
 */
#ifndef UART_PIN_RX
#define UART_PIN_RX 19
#endif

@caizelin I need to add these lines at the end of the file or change the whole file??

caizelin commented 5 years ago

@Yug11 Just set UART_HWFC to NRF_UART_HWFC_DISABLED, UART_PIN_TX to 20, UART_PIN_RX to 19

caizelin commented 5 years ago

BTW, you can also try the pre-built ncp firmware ot-ncp-ftd.hex.

Yug11 commented 5 years ago

@caizelin I have tried both the methods but none of it worked

Screenshot from 2019-03-25 15-06-10

Yug11 commented 5 years ago

once it went up to this stage and lagged, after that, I tried it again but the same error occurred

Screenshot from 2019-03-25 13-41-25