Shop OBEX P1 Docs P2 Docs Learn Events
P2 evaluation board (#64000) and Parallax WX ESP8266 WiFi Module - SIP SKU 32420S, wireless how to ? — Parallax Forums

P2 evaluation board (#64000) and Parallax WX ESP8266 WiFi Module - SIP SKU 32420S, wireless how to ?

I have P2 evaluation board (#64000) and Parallax WX ESP8266 WiFi Module - SIP SKU 32420S, how to get wireless working...? is there a P2 program ( in C/C++ preferably) ...?

-Thanks
-Alok

Comments

  • All you need is a P2 WX Adapter Add-on Board.

    What do you want to do over WiFi?

    You can talk to the P2 using telnet or use it just like you would on a P1.

    You can even program the P2 over telnet if you want.

    Mike
  • I want to run a web server on P2 evaluation board , which program I should be using ...? can you give me program (where it is located in sample folder in flexprop ...?)
  • There is a web server on the WX module that will serve the pages and pass data to the P2 but the P2 can not be a webserver using that module.

    You would need to custom WiFi module that passed html data directly to the P2 which has not been done.

    Mike
  • iseries wrote: »
    There is a web server on the WX module that will serve the pages and pass data to the P2 but the P2 can not be a webserver using that module.

    You would need to custom WiFi module that passed html data directly to the P2 which has not been done.

    Mike
    It is possible to serve web pages from the Propeller. There is a way to listen for HTTP requests with a specified URL. I had an example of how to do that but Parallax decided not to use the library code I wrote so you should probably check with @"Andy Lindsay (Parallax)" about how to do it with the current SimpleIDE libraries.

  • JonnyMacJonnyMac Posts: 9,104
    edited 2020-12-17 17:32
    It is possible to serve web pages from the Propeller.
    It seems like there should be a way. I've looked at some Arduino examples (which appear to be a derivative of one project) and they all store the HTML in the application code and send to the ESP module. As Mike points out, it may require a different bit of code inside the ESP. That said, perhaps @VonSzarvas can chime in as he is the lead of the team on ESP programming adapter.
  • JonnyMac wrote: »
    It is possible to serve web pages from the Propeller.
    It seems like there should be a way. I've looked at some Arduino examples (which appear to be a derivative of one project) and they all store the HTML in the application code and send to the ESP module. As Mike points out, it may require a different bit of code inside the ESP. That said, perhaps @VonSzarvas can chime in as he is the lead of the team on ESP programming adapter.
    You need to check with Andy. He's the one, as far as I know, who wrote the Propeller library code to interface with the WX module. I *know* the module itself has a way to listen on specified URLs and respond to HTTP requests on the processor attached to the WX serial interface.

  • Hello,

    how do you install lib wifi in flexprop ( C/C++)...? for P2

    could you give me instructions on how to install prerequisites so that I can get wifi working

    -Thanks
    -Alok
  • I will tell you how to build a custom library in Flexprop.

    In this example I'm building a function to blink LED 56.

    The function will be called doblink()

    First in Flexprop click on the File menu option and then Library Directories...
    In there add a folder where you want to keep your libraries. I used C:\Custom

    Next I will build my c function library shown here:
    
    void doblink()
    {
        _pinl(56);
        _waitms(500);
        _pinh(56);
        _waitms(500);
    }
    [/code>
    I will save this program as myblink.c
    
    Next I will build my include file:
    [code]
    /**
     * @brief MyBlink Library
     * @date January 1, 2021
     * @author Your Name
     * @version 1.0
     */
     
     /**
      * @brief blink led 56
      */
     void doblink(void) __fromfile("libmyblink/myblink.c");
    
    I will save this code as myblink.h

    Now put the include file above in your custom library location.
    Put the C program in a folder called libmyblink to match the above fromfile statement
    That's it.

    Now here is a sample program that uses this new library function.
    /**
     * @brief New library program
     * @author Your Name
     * @date January 1, 2021
     * @version 1.0
     */
     
     #include <stdio.h>
     #include <propeller.h>
     #include "myblink.h"
     
     void main()
     {
         
         while (1)
         {
             doblink();
         }
         
     }
    

    Now to move libWifI over is going to take some work as it was built for the WX boards sold by Parallax and this code needs to be removed to work with the P2. In addition it uses the full duplex object for the P1.

    Also you don't need this library to use the ESP WX board. Most of the functions use straight text that are shown in the API guide with this product.

    Mike
  • thanks for giving me steps, I installed libWifi as mentioned , now I am trying to compile following sketch

    #include "simpletools.h"
    #include "wifi.h"

    int main()
    {
    wifi_start(9, 8, 115200, USB_PGM_TERM);

    print("Leave a Network\r");

    // Leaves network where it was a station and sets
    // the Wi-Fi module's mode to AP.

    wifi_leave(AP);

    // Verify mode after leaving the network.

    int mode = wifi_mode(CHECK);

    switch(mode)
    {
    case STA: //0xf4:
    print("mode=STA\r");
    break;
    case AP: //0xf3
    print("mode=AP\r");
    break;
    case STA_AP: //0xf2
    print("mode=STA+AP");
    break;
    }
    }
    and I am getting following error

    /SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext/simpletext.h:59: error: #error "This library requires 32bit doubles"
  • If you're using SimpleIDE, try clicking the two little icons at the bottom (and toward the left) of the SimpleIDE window.

    They will reveal a couple windows. On the left window, you should see three tabs. The 2nd or 3rd include options for various compile options. One of those is a 32-bit something. (don't recall exactly). But enabling might help.
  • thanks for info, compilation using simpleIDE works, but when I try to compile in Flexprop (GUI) I get following


    /include/wifi/wifi.h:83: error: Can't open include file "fdserial.h"
    #include "fdserial.h"
    from /Users/akmishra/Documents/SimpleIDE/propellar_wifi_alok_1.c: 6: #include "wifi/wifi.h"
    1 error in preprocessor.

    is there a way to compile program for P2 in simpleIDE ...?
Sign In or Register to comment.