Shop OBEX P1 Docs P2 Docs Learn Events
Struggling with the WX WiFi Module — Parallax Forums

Struggling with the WX WiFi Module

I'm trying to integrate with the 32420S Parallax WX ESP8266 WiFi Module - SIP

The UART to the P1 or P2 tend goes into an endless loop...

I can connect to the wifi; put I can only look at a handful of pages when it starts returning 502 errors on page requests. I ran the update to firmware 1.4

I'm not sure what I did

I'm using the demo code:

  • esp32_core.spin2
  • esp32_tcpip.spin2
  • esp32_tcpis_tl2_beta.spin2
  • esp32_wifi.sipin2

  • testesp32.spin2

  • testesp32tl2.spin2

Propeller Tool 2.7.0 (Beta)

I've tried

  • P1 Propeller Activity Board
  • P2 EVAL board with P2 EVAL WX ADAPTER

I have 2 of the WX WiFi modules, neither of than work

Comments

  • I'm not familiar with that demo code, but from the naming it seems to target the ESP32 module, whereas the Parallax WiFi module is using the smaller ESP8266. Something in the code might be conflicting or incompatible ?

    Another thing to make sure is that floating pins connected to the control pins on the SIP header are not causing unexpected behaviour. Especially the PGM and RES pins.

    BTW... The latest firmware is v1.5 : https://drive.google.com/drive/folders/17Xh9A80skNweDfcSq5MR087GqHrKvtOK

  • thank you for /he details to verify?

  • does anyone have a working example?

  • I changed the Wifi AP to be the house one, TCP/HTTP works much better now!

    It's going into an endless loop on the com.StrInMax call in wifi-test.init method

    Thanks
    Jay

  • It appears to be this line:

    com.StrInMax(@str_buffer, MAXSTR_LENGTH - 1)

    If I comment out this line, the code works.

    If I leave this line in it fails/hangs

    Jay

  • Is the value of MAXSTR_LENGTH - 1 larger than the size of @str_buffer ?
    That would cause an overflow and bad things to happen for sure.

  • str_buffer byte 0[MAXSTR_LENGTH+1]

    it was in VAR, this morning I tried moving it to local and VAR

    I have sample code attached to the first comment...

    Jay

  • Could you archive the code and attach that zip here instead, so we get the obj code files included ? (Propeller Tool / File / Archive)
    I don't have that StrInMax function in my version of FDS, and anyway, best to look at this fully "on the same page".

  • @VonSzarvas said:
    Could you archive the code and attach that zip here instead, so we get the obj code files included ? (Propeller Tool / File / Archive)
    I don't have that StrInMax function in my version of FDS, and anyway, best to look at this fully "on the same page".

    I took the Project + Propeller Tool option attached

  • VonSzarvasVonSzarvas Posts: 3,278
    edited 2022-11-22 17:58

    OK, that works.

    The function StrInMax is waiting for a NL (new line char), right ?

    So are you certain that character is actually arriving ?
    Seems to be why the code would seem to hang, as it's waiting.

    Have you tried some debugging around that area, so we what's actually arriving?

    For example:

    '  com.StrInMax(@str_buffer, MAXSTR_LENGTH - 1)
    
      repeat
        pst.Char(com.Rx)
    
    
      okay := @str_buffer
    

    or

    '  com.StrInMax(@str_buffer, MAXSTR_LENGTH - 1)
    
      repeat
        pst.Hex(com.Rx, 2)
        pst.Char(" ")
    
    
      okay := @str_buffer
    

    As another approach...

    Maybe your incoming data is LF (10) terminated, instead of NL/CR (13).

    Add the LF definition to your CON block, then substitute LF in place of NL within the StrInMax function.

    CON
      NL = 13  ''NL: New Line  (aka CR - Carriage Return)      
      LF = 10  ''LF: Line Feed
    
  • Do'h (now I remember) I added "Available" and "StrInMax" to the shared version of FullDuplexSerial; then totally forgot I did that...

    My problem still exists, I need to read a string with FullDuplexSerial,

    The delimiters are defined by the WX WIFI Module defined, I'm trying to read data gram packets.

    Thanks
    Jay

  • Did you confirm yet, if delims are NL or LF ?

  • According to _Parallax WI-FI Module ($32420) Firmware Guide__ the end marker is a byte value of 13

    It's getting hung up on the com.Rx call.

    Do I need to set command mode???

    Off to set command mode..

  • With the help of the parallax support team I got it to work,

    I was putting the set command mode in the wrong place; it needs to go before the call to serial init.

    Thank you VonSzarvas and Michael

    Jay

  • @jay_harlow said:
    With the help of the parallax support team I got it to work,

    I was putting the set command mode in the wrong place; it needs to go before the call to serial init.

    Thank you VonSzarvas and Michael

    Jay

    Hey, I need some help. I have to send data (1Mbyte to 3Mbyte) to p2 from Rpi.
    should i use wifi module for communication?
    note: I need fast speed data transfer communication. at least 8Mbits/s.

    Thanking you in advance!

  • I would not use WiFi for that. It’s unreliable and the interface to the P2 is serial. Which struggles with 8MBit/s. Using smart pins you should achieve that throughput with SPI without problems.

Sign In or Register to comment.