Shop Learn
FlexBASIC P2 WiFi — Parallax Forums

FlexBASIC P2 WiFi

Since I am starting to use the P2 WiFi, I am wondering how the 'mount "/host", _vfs_open_host()' command would work? If I ever get the telnet to work properly, how would that work with '/Mount "/host", ...'.

Thanks

Ray

Comments

  • ersmithersmith Posts: 5,329

    @Rsadeika said:
    Since I am starting to use the P2 WiFi, I am wondering how the 'mount "/host", _vfs_open_host()' command would work? If I ever get the telnet to work properly, how would that work with '/Mount "/host", ...'.

    I don't know what you're asking here. The _vfs_open_host() works over the "serial" connection (from the Prop's point of view) on pins 63 and 62. It will continue to work fine if that serial connection is in turn forwarded via telnet to the PC host, as long as that host is running the file server (built in to proploader). That's the default setup for the WiFi.

    If you set up your own telnet connection different from the default one, then you'll have to arrange to have a file server running on the other end of the telnet connection.

  • RsadeikaRsadeika Posts: 3,685

    I went ahead and did an up date of the latest flexprop, for my Raspberry Pi PC Desktop system. I noticed that some thing is changing the name of my WiFi module.

    Below is a copy of what my WiFi settings are set at after flexprop does a scan for ports. Is flexprop doing some other subtle changes each time it does a scan for ports? As of this moment flexprop, when I do a compile and run, it cannot find the port. Not sure if the WiFi module is now mangled in some way.

    Ray

    Module name:    
    9
    Loader Baud Rate:   
    115200
    Reset Pin:  
    DTR (GPIO12)
    Communications Baud Rate:   
    115200
    Communications Stop Bits:   
    1 Stop Bit
    Debug Baud Rate:    
    115200
    Debug Stop Bits:    
    1 Stop Bit
    Debug Output:   
    Disabled
    Serial Commands (aka CMD):  
    Disabled
    Command Start Character:    
    0xFE
    Command Pause Time in MS:   
    0
    Command Pause After Characters: 
    :,
    Command Events: 
    Disabled
    Hide from Loader:   
    No
    P2 Drag/Drop Loader:    
    Disabled
    
  • ersmithersmith Posts: 5,329
    edited 2022-02-09 14:54

    You don't have the newest version of flexprop. Delete all of your config files and start again:

    rm -f ~/.flexprop*
    rm -rf ~/flexprop
    

    then follow the instructions in the README.md for building on Linux.

    WARNING: type the rm commands I gave above exactly as shown; in particular make sure there's no space before the `*' symbol.

    You can fix the name change with the web interface of the WiFi module.

  • RsadeikaRsadeika Posts: 3,685

    Something weird is going on.

    My system, P2 Edge rev B with a WiFi card, when I add, to my program, pinlo 56 and pinlo 57 and then do a Compile and flash, it is doing something to the WiFi card.

    Normal scenario, with the WiFi card plugged in, the blue LED will be flashing. When I do the Compile and flash, with the pinlo commands in the program, and then turn the P2 Edge system back on, the blue LED is no longer flashing which means the system is no longer working. Is this some kind of hardware issue that I am having with my system, and is this a problem with other peoples P2 Edge rev B with WiFi card setups.

    Ray

  • RsadeikaRsadeika Posts: 3,685

    As I mentioned in another thread, using the WiFi is a very frustrating situation. Is it the hardware or is it the software, or is it a little of both.

    The projects that I have in mind, will be using the WiFi capabilities. I am not sure what direction to go now. I hate the idea of switching over to the RPi, and dumping the P2.

    Maybe Parallax should think about a P2 Edge that has the WiFi, uSD built in, and all of the connection problems worked out, so you do not have to rely on too many dip settings to get things too work properly, this is just an idea.

    Ray

  • JonnyMacJonnyMac Posts: 8,091
    edited 2022-02-21 16:39

    [deleted]

  • After spending the morning getting a Pi to reliably delay mounting an NFS drive until AFTER the wifi connection is up I feel your pain the same but different. But I digress...

  • RsadeikaRsadeika Posts: 3,685

    I am now seriously considering pulling the P2 Edge setup from my project and replacing it with an Activity Board WiFi setup. I can always use the P2 Edge setup in some other project that does not require WiFi.

    If I do the switch, I know that I will be running into memory constraints with the P1. At the moment, with the P2 Edge setup, my program is up to 70K in size. Not sure as to how I will make it fit in less than 32K, will coding every thing in PASM make it fit?

    I have used FlexBASIC with the Activity Board WiFi, and I know that works, as expected. I have a lot to think about at the moment, which way should I go.

    Ray

  • JonnyMacJonnyMac Posts: 8,091

    Wait... you're saying you can't make a P2 work where a P1 does now?

  • RsadeikaRsadeika Posts: 3,685

    Yes, from a WiFi perspective.

    Ray

  • MicksterMickster Posts: 2,084

    I probably misunderstand the issue but there are alternative wireless modules.

    https://tibbo.com/store/modules/wm2000.html

  • RsadeikaRsadeika Posts: 3,685

    I am trying a small test program:
    mount "/host", _vfs_open_host() ' Mount FS
    open "/host/global.txt" for append as #3
    I have done a Compile and flash, using serial. I switched over to WiFi, and started up the P2. Where should I be looking for the global.txt file. My host is the Linux system.

    Ray

  • iseriesiseries Posts: 1,267

    I have been using a the Wifi module with my p2 rev b Edge for over a year now and have no issues. I can load programs over the Wifi and connect it as a terminal.

    I also have an SD card attached as well. That works great. I however do not use plan 9 as I don't see the purpose. I write to the SD card either from my PC or from the P2 by moving the card between them.

    Mike

  • ersmithersmith Posts: 5,329

    @Rsadeika said:
    I am trying a small test program:
    mount "/host", _vfs_open_host() ' Mount FS
    open "/host/global.txt" for append as #3
    I have done a Compile and flash, using serial. I switched over to WiFi, and started up the P2. Where should I be looking for the global.txt file. My host is the Linux system.

    I'm not sure this will work very well from flash -- the _vfs_open_host() call will have to communicate with the loader program, so that will have to be running when you boot. The global.txt file will end up in whatever directory you launch the loader from.

  • RsadeikaRsadeika Posts: 3,685

    Since I use the GUI exclusively, not sure what other things I could do within the GUI to have a loader launch from within flash.

    So, at the moment it narrows down the usage to the uSD, but that is very limiting, from perspective. I guess if there was an editor program the ran from within a FlexBASIC program, you could theoretically create and manipulate files on the uSD. But, still, when using the WiFi setup you would not be able to upload a file(s) to the host system.

    On the SimpleIDE program, it has the capability to interact with a WEB browser for control of a program from the browser, not sure if FlexBASIC will going that way anytime soon.

    I was looking at possibly using Python socket to maybe make use of the WiFi aspect to handle the file(s) need, but as I have read, in order to make it work efficiently, you would have to set up some kind of server/client mode, which I think that FlexBASIC cannot do.

    Ray

  • iseriesiseries Posts: 1,267

    So what you want to do is compile some data onto the SD card and then at some point ftp that file to a host computer for processing using BASIC.

    The Wifi module also has webserver and a way for you to define URL's that can interact with the P2 to provide data to the request.

    You can also open sockets and udp connections to send data between programs connected to the Wifi network or over the internet for that matter.

    Mike

  • RsadeikaRsadeika Posts: 3,685

    Now, what I normally do is, start up with the WiFi, and then, in the Special, I start up FlexProp ANSI Terminal. That seems to be working fairly well, as a connection to the WiFi.

    I wonder if there could be some way of modifying the Terminal to achieve the usage of 'mount "/host", _vfs_open_host()'. It would be even more interesting to see if the FlexProp ANSI Terminal, could be made as a stand alone, and be able to connect to the WiFi. Then it could be expanded on to do other things. Just thinking at the moment.

    Ray

  • RsadeikaRsadeika Posts: 3,685

    Are there any Parallax WiFi experts here?

    I was looking at the Parallax WiFi firmware pdf, and I noticed that their is a way to use things like 'POST' and 'GET', and other stuff. Anybody know how this could be implemented using FlexBASIC. Maybe some simple examples, if possible, could be a help.

    Ray

  • iseriesiseries Posts: 1,267

    Get and Post deal with the browser side of the Wifi module and can be used to pass information to a program listening on the serial connection.

    It's been a long time since I wrote a basic program, CBASIC, RBASIC, ZBASIC or even VB-BASIC.

    The Wifi module has to have commands turned on and then you tell it what path you want to listen for:

    LISTEN:HTTP,/myapp

    Then you would use:

    POLL:

    It will return a value that indicates the type of request that is active and you need to retrieve those values and send a reply before the browser times out the connection.

    MIke

  • RsadeikaRsadeika Posts: 3,685

    I will not be doing any P2 stuff for awhile. Last night I saw smoke arise from my P2 Edge setup, by mistake, power source was not 5V. The Activity Boards are something like 6-26V, the P2 Edge should be something similar, to ward off power supply issues.

    I have some FLiP modules, so I will be doing some P1 projects for awhile.

    Ray

  • iseriesiseries Posts: 1,267

    The new P2 edge modules now except 5 - 16v if that helps.

    Mike

  • JRoarkJRoark Posts: 1,046

    @Rsadeika said:
    Last night I saw smoke arise from my P2 Edge setup, by mistake, power source was not 5V.
    Ray

    You are in good company, Ray. I smoked a Rev B eval board under similar circumstances. My mistake was not remembering that my bench supply (at the time, since replaced) defaulted to 12.0 volts. You could adjust voltage up or down from there, but it always started at 12v with the output set to "off". Without thinking, I punched the "output on" button without resetting the voltage. Needless to say, I gained some experience with SMD rework that day. After a few mis-starts and re-re-replaced components, the reworked board eventually worked and it remains on the bench to this day as my "beater" board.

Sign In or Register to comment.