i am trying to implement WiFi for the Particle Argon in Rust.
I think the esp32 chip is connected via uart to the nrf52. (
https://docs.particle.io/assets/images/argon/argon-block-diagram.png) but am not 100% sure.
I tried reverse engineer the cpp code (
device-os/esp32_ncp_client.cpp at develop · particle-iot/device-os · GitHub) but could not get a response from the esp32 when i send an AT command there is no response. ( Basic AT Commands — ESP-AT User Guide documentation) I just sent a basic “AT\r\n” but get no response.
For uart i used the pins from the layout. I tried to use the rts/cts pins manually and with the provide nrf52 uarte hal.
For the baudrate i used 921600.
Before i started the transmission i set wifi_en and boot_mode high. (I got this from the cpp file)
As of now i tried a lot of different parameters but cannot get a response from the esp32. I tried uart with an external device and sending and receiving data works fine there.
Can you show your code?
Serial1 is not the UART you’d use to talk to the NCP.
However, it would be a nice feature request to implement a
WiFi.command() API à la
Here is the rust code. (Just test code at the moment)
I thought it would be serial as it is initialized here:
#if PLATFORM_ID == PLATFORM_ARGON
#elif PLATFORM_ID == PLATFORM_ASOM || PLATFORM_ID == PLATFORM_TRACKER
// Initialize serial stream
std::unique_ptr<SerialStream> serial(new(std::nothrow) SerialStream(HAL_USART_SERIAL2, ESP32_NCP_DEFAULT_SERIAL_BAUDRATE,
SERIAL_8N1 | SERIAL_FLOW_CONTROL_RTS_CTS));
std::unique_ptr<Esp32SdioStream> serial(new(std::nothrow) Esp32SdioStream(HAL_SPI_INTERFACE2, ESP32_NCP_DEFAULT_SDIO_SPEED, WIFI_CS, WIFI_INT));
#endif // !HAL_PLATFORM_WIFI_NCP_SDIO
// Initialize muxed channel stream
decltype(muxerAtStream_) muxStrm(new(std::nothrow) decltype(muxerAtStream_)::element_type(&muxer_, ESP32_NCP_AT_CHANNEL));
I kind of have the same issue trying to bootstrap the communication. It seems
@heusini uses the proper pins, is it maybe that the UARTE is not capable of directly speaking to them?
This is the code I used to test communicating with the ESP32 from Device OS. I was able to send AT commands and get responses with this.
// Disable ESP32. It appears to be turned on by default even in SEMI_AUTOMATIC mode
// Enable ESP32
// Set up serial
Serial2.begin(921600, SERIAL_FLOW_CONTROL_RTS_CTS); // 115200
Thanks for testing.
So if you do Serial2.write(“AT”); you get “Ok” when you do Serial2.read();
You do need an
\r\n after the AT command because you need a line terminator, and the OK is uppercase, but yes. It might take a couple tries after rebooting the ESP32. I had a loop of up to 4 retries.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.