SimpleIDE WiFi

13567

Comments

  • edited February 10 Vote Up0Vote Down
    For programming a QuickStart, use:

    P31 - DO
    P30 - DI
    RESn - Wi-Fi DIP pin 18

    Coming soon: Firmware support for Propeller QuickStart RESn to Wi-Fi SIP/RTS.
  • I put together another platform using a QuickStart borad, WiFi SIP, and a breadboard, plus a voltage regulator.

    I have:
    QS - WiFi SIP
    P31 - DO
    P30 - DI
    RESn - RESn
    Gnd - Gnd
    3.3V - 3.3V
    No USB connection, just straight up 5.3V power to the QuickStart board.

    The WiFi connection is OK, shows up in SimpleIDE, compiles OK, but it is not downloading, so I get an error. Theoretically my setup should work, I double checked the wiring and that is as described, but not sure why it is not behaving the way it should be.

    What am I missing now?

    Ray
    /*
      progwifi.c
      Feb 9, 2017 
    */
    #include "simpletools.h" 
    #include "wifi.h"
    
    int main()
    {
      // Add startup code here.
      pause(2000);
    /*         DI DO                 */
    wifi_start(31, 30, 115200,WX_ALL_COM);
    
    
      print("Hello World\n");
      while(1)
      {
        // Add main loop code here.
    
      }  
    }
    
  • edited February 10 Vote Up0Vote Down
    Did you try what I said earlier?

    For programming a QuickStart, use:

    P31 - DO
    P30 - DI
    RESn - Wi-Fi DIP pin 18

    Coming soon: Firmware support for Propeller QuickStart RESn to Wi-Fi SIP/RTS.
  • I am using the WiFi SIP module, and I do not see a pin 18, I see a 015 and some others but no pin 18.

    Ray
  • The SIP module has 20 holes for DIP pins. Pin 18 is the third from top-right (counting counterclockwise from pin 1 on the top-left). That's the pin that toggles the Propeller's reset line when it is plugged into the Activity Board WX to initiate a restart for program loading. The next firmware will allow you to use /RTS on the SIP header for the same purpose.
  • For a quick test, I inserted the jumper wire into the pin 18 hole and then plugged it into the breadboard without pre-bending the wire. That gave it a little tension to maintain maintain electrical contact.
  • Thanks Andy, I just tried your suggestion, using pin 18, and no luck. So, it must be something else that is going on. The one thing that I did notice, on the WiFi SID module the blue LED is on, but it does not flash, like on the DIP module, is it supposed be solid blue or flashing blue?

    While on the subject of the SIP module, I noticed four pin group designated as "Propeller Plug", what can be done with that? I think I have a Propeller Plug, laying around somewhere.

    I am going to spend some more time with the AB WX and WiFi DIP module, have to see how to do an html, that does something exciting.:-)

    Ray
  • Hi Ray,

    I'll re-test that. I don't have a QuickStart, but I do have a DIP package with /RESn and P31/P30 access, so I'll try it and let you know.

    The light flashing behavior is explained in the Wi-Fi Module Guide, page 5, item 6.

    https://www.parallax.com/downloads/parallax-wx-esp8266-wi-fi-module-product-guide

    A solid ASSOC light means it's functioning as an access point, and it has a station IP address but is not connected to it. If you have not already made it join a network, the fact that it has a station IP address probably because when it was tested in manufacturing two of the test steps are joining and leaving our test Wi-Fi network.

    That in mind you would want to join its network with your computer to program it. You could also make it join you home Wi-Fi. and let your computer rejoin it and program the Propeller that way.

    About the Prop Plug silkscreen. New firmware is typically loaded over the air (OTA) by clicking a couple buttons in the configuration web page interface. We also added the ability to load firmware through the Propeller plug. That's what those the Propeller Plug markings are for on the SIP module. A third option is to load the firmware through an Activity Board.

    Andy
  • edited February 11 Vote Up0Vote Down
    I won't be able to test the SIP programming today, so I'll have to get back to you with verification about Pin 18. I'm pretty sure that's the one sending the reset signal, and it's the third down from top-right. (When looking at the silkscreen side)

    You could also try unplugging USB, and plug in battery power, or regulated 5 V or 3 V + common GND from your activity board. That could rule out the resting states of the USB programming interface overriding signals to the QuickStart from the SIP module.

    Last but not least, make sure you know which wx-##### is the DIP, and which is the SIP. You can also give them custom names in the web interface. I have accidentally programmed Miguel's Wi-Fi module over in Tech Support while I was testing things because I wasn't paying attention to the Wi-Fi module's SSID.
  • Yes, silkscreen side, third down top-right. I was using a solid core wire that had a nice snug fit in the hole. As for power supply, my WiFi SIP platform uses regulated power, and I do not have the USB plugged in. For the last item, I only have one WiFi on, at a time, so there is no confusion as to which wx-#### to use. I try to keep things as simple as possible in order to reduce possible errors.

    Yesterday I got the AB WX and WiFi DIP working to my satisfaction, so now I will press forward. I had a chance to look at the tutorial that covers the next step.

    I would have chosen a different approach, but that is just me. I first looked at the PropGCC code and the html/js code, just to get a feel for what is going on, and in the simplest form, there is a lot that is going on. I would suggest that there should be a lot more coordinated comments in the code, especially when the C code is providing functionality for the html/js code.

    After my first look see into the code, I still do not understand the fine points of how the C code is providing the html/js code to make the whole thing work. Those parts should have more comments attached. This is a very important concept, which you should have a total grasp of, otherwise when you try to do some code to maneuver your robot, via the html/js code, you could get bogged down very easily.

    For the last point, I guess, in order to get your html/js file onto the WiFi module, you have to go to the 192.168.4.1 firmware screen and use the file command to get that done. Then in order to run the application you have to do, in your browser, 192.168.4.1/files/xxxx.html. I hope that down the road this procedure does not get to confusing when you start using the WiFi with a different assigned address.

    Now back to reading some more of that tutorial.

    Ray
  • The QuickStart board has an FTDI chip connected to P31/30. Could that be interfering with the communications between the ESP8266 over DI/DO connected to the same pins?
  • edited February 11 Vote Up0Vote Down
    Hi Ray,

    First installment. Yeah, you are now out of the plug-and-play area and into some pretty in-depth material. It's an intermediate step for us targeted as supplementary material for more advanced classes. We have other material in the pipeline for younger grades that makes it all happen in a graphical drag, drop, and click kind of way. So, stay tuned.

    About comments, for the time being, you should focus on paragraphs above and below the code examples as you read. They explain what each part of the code does in detail.

    When I'm working with more in-depth code examples like that, I hand type from the screen or printout into my programming software. After I get the basic example working, I also experiment with some variations to make sure I've got it figured out.

    Andy
  • edited February 11 Vote Up0Vote Down
    Hi again Ray:

    Second installment: I just verified that SimpleIDE can load code into a QuickStart through a Wi-Fi SIP module. Here is the setup I used:

    5 V to QuickStart Vin
    GND to QuickStart GND
    3.3 V to SIP Module Vin
    GND to SIP Module GND
    SIP Module DIP hole 18 to QuickStart RESn
    SIP Module DO to QuickStart RX
    SIP Module DI to QickStart TX

    Andy

    P.S. I left the USB port disconnected for this.
  • Andy what you just described, that is exactly the same connections that I had done. In fact I just tried it on two different boards, the DNA-RTC and my legacy Propeller Platform board. The Propeller Platform board does not have the FTDI chip but a Propeller Plug. Is my WiFi SIP module bad?

    Just to quadruple check, I have the Propeller Plug handy, can that be used to verify if the WiFi SIP module is in working order?

    As a side note, I think there might be something wrong with the SimpleIDE port selection. I just tested it by choosing a port that the cable is not assigned, in this case COM1, hit the Run and it comes back with an ERROR. It used to come back with no Propeller chip message, now you start to think that there is something wrong with your program, and not that you have not selected the right COM port.

    Ray
  • edited February 11 Vote Up0Vote Down
    In the case of COM1, it should say:

    ..Build Succeeded!

    That indicates there's nothing wrong with your program.

    Later, it should say:

    ERROR: Download failed: -1

    Which means that loading the code into the Propeller is the step where SimpleIDE got stuck.

    Is that what you see? Does that really make you think there's a bug in your code?

    As for testing, check the Settings page against the settings page for your DIP module. After that, try adjusting your Activity Board WX so that it runs a program with USB programming and debugging using the "Program and Optionally Terminal over USB, Wi-Fi App Data Through I/O Pins" setup on this page:

    http://learn.parallax.com/tutorials/language/propeller-c/parallax-wx-wi-fi-module-prop-c/connect-wx-wi-fi-module-your

    For test applications, I usually use one of these:

    http://learn.parallax.com/tutorials/language/propeller-c/parallax-wx-wi-fi-module-prop-c/load-and-view-test-page

    -- or --

    http://learn.parallax.com/tutorials/language/propeller-c/parallax-wx-wi-fi-module-prop-c/web-page-controlled-led-lights

    Once that works for your DIP module, remove the DIP module and put the SIP module into the breadboard. Then, 3.3 V to Vin+, GND to GND, P9 to DO and P8 to DI. Remember to load the same page into the SIP that you loaded into the DIP. If it runs, our only unknown will be the hole for Pin 18 connection to /RESn.

    Andy
  • Andy, It Sunday! Take a day off! :)
    Infernal Machine
  • David BetzDavid Betz Posts: 11,472
    edited February 11 Vote Up0Vote Down
    Publison wrote: »
    Andy, It Sunday! Take a day off! :)
    Only Saturday here. ;-)

    I woke up thinking today was Sunday. Senior moment. :)

  • I will probably start a new thread in the robotics forum, after I create an outline for the projects requirements and timeline. This is just an overview using the Propeller Acitivity Board WX and the Parallax WX WiFi DIP module.

    The new AB WX, the most important part, it can now handle the raw power from the Roomba battery source, even when it is in the charging mode.

    The new Parallax WX WiFi DIP module setup now allows me to program the board, OTA, no USB cable necessary. I can also place the Roomba on the floor or even put it in the attic, and be able to program it.:-)

    I just tried a very quick and dirty program just to make sure it is using the OTA capability. Probably the next thing will be is to attach a voltage divider and use the AD to check and see what kind of power it is using with the WiFi in operation.

    Then maybe the next step will be is to see if I can create an html/js to have a visual of the voltage, updated in the browser. Already this sounds to be a very ambitious project.

    Ray
    1936 x 1296 - 681K
    1936 x 1296 - 694K
    1936 x 1296 - 672K
  • That sounds like a fun project Ray! We'll look forward to updates in your new thread.

    Andy
  • I wired up the voltage divider and tried my hand at html. Unfortunately it is not working as expected. The html shows the button, but I do not see any voltage value. My AB WX is wired with SEL -> 3.3V.

    I did run the val-from-micro example just see what I am supposed to see, even in that example, when I press update it only updates just one time, and then it does nothing else. I thought pressing the update, you would get a constant update, not just one time. I think I am missing something here.

    Ray
    /*
      wificr1.c
    
      Feb 12, 2017
      Activity Board WX + Parallax WX WiFi, powered by Roomba.
      
    */
    #include "simpletools.h"
    #include "wifi.h"
    #include "simpletext.h"
    #include "fdserial.h"
    #include "adcDCpropab.h"
    
    int event, id, handle;
    int getFromPageId;
    float vx;
    
    int main()
    {
      // Add startup code here.
      print("WiFi prototype for Roomba\n");
      adc_init(21, 20, 19,18);
      float v0;
      
      getFromPageId = wifi_listen(HTTP, "/tpfm");
      print("PageId = %d\n", getFromPageId);
     
      while(1)
      {
        // Add main loop code here.
        v0 = adc_volts(0);
        pause(100);
        vx = (v0*2);
        print("%f\n",vx);
        
        wifi_poll(&event, &id, &handle);
        print("Event = %c, id = %d, handle = %d\r", event, id, handle);
        if(event == 'G')
        {
          if(id == getFromPageId)
          {
            print("Incoming GET request, sending %f\r", vx);
            wifi_print(GET, handle, "%d", vx);
          }        
        }      
        pause(500);
      }  
    }
    
    xxxx.html
    <!DOCTYPE html>
    <html>
    <body>
    	<H2>Value from wificr1</H2>
    	<p>Click Update to see value:</p>
    	<button onclick="getFromMcu()">Update</button>
    	<p id="value">Waiting...</p>
    
    	<script>
    		function useMcuReply(response)
    		{
    			var vx = document.getElementById("value");
    			vx.innerHTML = "Value: " + response;
    		}
    
    		function getFromMcu()
    		{
    			httpGet("/tpfm", useMcuReply);
    		}
    
    		function httpGet(path, callback)
    		{
    			var req = new XMLHttpRequest();
    			req.open("GET", path, true);
    			req.onreadystatechange = function()
    			{
    				if(req.readyState == 4)
    					if(req.status == 200)
    						callback(req.responseText);
    					else
    						callback("Waiting...");
    			}
    			req.send(null);
    		}
    	</script>
    </body>
    </html>
    
  • Hi Ray, the Val from micro application only updates when you click the button. The push-button application updates every few seconds. Try holding the push button down for a good long time, and see if the web page updates. I am not by my computer right now, and I don't remember which tutorial it is, but one of them guides you through increasing the rate of GET requests the JavaScript makes the browser send to the propeller through the wifi module. Andy
  • edited February 12 Vote Up0Vote Down
    Place holder.
  • can we use the simpleide with AB-WX and xbee S6B wifi ? or is it only compatible with ESP-wifi ?
  • laurent974 wrote: »
    can we use the simpleide with AB-WX and xbee S6B wifi ? or is it only compatible with ESP-wifi ?
    I'm sure you can use the S6B with the AB-WX but you won't be able to use it to load the Propeller. The S6B is not programmable so we were not able to write a Propeller loader that would run on the S6B module. While it is possible to load the Propeller over a S6B connection, it's not easy to make it reliable due to unpredictable network transmission delays. The WX works by doing the Propeller ROM loader program on the ESP8266 itself to avoid any timing issues.

  • I did some more testing this morning, and I am not having much success at getting it to work as expected.

    Below, I just about cleared out a lot of code, and I entered some debug points. The program below, %99.5 of the time gets to the first debug, while viewing in the terminal screen, and goes no further. I am using the html file that I posted in the earlier post.

    At this point I would have to guess that the PropGCC program is having problems communicating with the html/wifi connection?

    Ray
    /*
      wificr1.c
    
      Feb 12, 2017
      Activity Board WX + Parallax WX WiFi, powered by Roomba.
      
    */
    #include "simpletools.h"
    #include "wifi.h"
    //#include "simpletext.h"
    //#include "fdserial.h"
    //#include "adcDCpropab.h"
    
    int event, id, handle;
    int getFromPageId;
    //float vx,vy;
    int val;
    
    int main()
    {
      // Add startup code here.
      print("WiFi prototype for Roomba\n");
    //  adc_init(21, 20, 19,18);
    //  float v0,v1;
    
      print("debug-1\n");  
      getFromPageId = wifi_listen(HTTP, "/tpfm");
      print("PageId = %d\n", getFromPageId);
      //print("debug-2\n");
     
      while(1)
      {
        // Add main loop code here.
        val++;
        /*v0 = adc_volts(0);
        pause(100);
        vx = (v0*2);
        print("Rail %f\n",vx);
        v1 = adc_volts(1);
        vy = (v1*4.9740);
        print("Battery: %f\n",vy); */
        
        wifi_poll(&event, &id, &handle);
        print("Event = %c, id = %d, handle = %d\r", event, id, handle);
        if(event == 'G')
        {
          if(id == getFromPageId)
          {
            print("Incoming GET request, sending %d\r", val);
            wifi_print(GET, handle, "%d", val);
          }
          //print("debug-3\n");        
        }    
        pause(500);
      }  
    }
    
  • One thing you can do to try to diagnose this problem is to connect a PropPlug to the DBG pin on the WX module. DBG should be connected to RX on the PropPlug and ground should be connected. There is no need to connect the PropPlug TX or reset pins. You should then see debug output from the WX if you set your terminal program to 115200 baud 8N1.
  • In this version I added 'wifi_start(31, 30, 115200, WX_ALL_COM);', now it seems to get past debug-1, but it never gets to debug-3 or debug-4. When I click the update button in the html, it updates one time, sometimes, and then there are no more updates after that. I am using the WX WiFi DIP with the AB WX, using a propplug for further diagnostics may be above my pay grade and expertise.

    Ray
    /*
      wificr1.c
    
      Feb 12, 2017
      Activity Board WX + Parallax WX WiFi, powered by Roomba.
      
    */
    #include "simpletools.h"
    #include "wifi.h"
    //#include "simpletext.h"
    //#include "fdserial.h"
    //#include "adcDCpropab.h"
    
    int event, id, handle;
    int getFromPageId;
    //float vx,vy;
    int val;
    
    int main()
    {
      // Add startup code here.
      wifi_start(31, 30, 115200, WX_ALL_COM);
      print("WiFi prototype for Roomba\n");
    //  adc_init(21, 20, 19,18);
    //  float v0,v1;
    
      print("debug-1\n");  
      getFromPageId = wifi_listen(HTTP, "/tpfm");
      print("PageId = %d\n", getFromPageId);
      print("debug-2\n");
     
      while(1)
      {
        // Add main loop code here.
        val++;
        /*v0 = adc_volts(0);
        pause(100);
        vx = (v0*2);
        print("Rail %f\n",vx);
        v1 = adc_volts(1);
        vy = (v1*4.9740);
        print("Battery: %f\n",vy); */
        
        wifi_poll(&event, &id, &handle);
        print("Event = %c, id = %d, handle = %d\r", event, id, handle);
        if(event == 'G')
        {
          if(id == getFromPageId)
          {
            print("Incoming GET request, sending %d\r", val);
            wifi_print(GET, handle, "%d", val);
            print("debug-3\n");
          }
          print("debug-4\n");        
        }    
        pause(100);
      }  
    }
    
  • edited February 13 Vote Up0Vote Down
    Your code isn't calling wifi_start. That could definitely explain the behavior you are reporting. Try adding the appropriate wifi_start call before calling any other wifi_... functions in your C code.
  • Rsadeika wrote: »
    II am using the WX WiFi DIP with the AB WX, using a propplug for further diagnostics may be above my pay grade and expertise.
    Well, there really isn't any difference between the DIP and SIP boards other than the connectors. You can solder a SIP connector onto the DIP board got get access to the DBG and GND pins.
  • I could not get the val-from-micro html to work. I was expecting the value to change every time you clicked on update, but that did not happen. Now, I did try the p26/p27 LED example, that worked as expected.

    Ray
Sign In or Register to comment.