[Aug 6] Debian Stretch Minimal 64bit (0.7.8) / Ubuntu 18.04 Bionic LXDE Desktop Image (0.7.8) / Ubuntu 18.04 Bionic minimal 64bit / 32bit Image (0.7.8) / Ubuntu 18.04 Bionic Containers Image (0.7.8) / Stretch OpenMediaVault OS Image armhf / Stretch OpenMediaVault OS Image arm64 ( 0.7.8) - ROCK64 | [June 25] Stock Android 8.1 - ROCK64 | [June 19] Armbian (5.42) - ROCK64 | [June 19] Armbian (5.38) - PINE A64(+) / PINE A64-LTS / SOPINE

Project Inspiration | Get Started | IRC Logs | Forum Rules/Policy

Using WiFi API
I am trying to use the WiFi api to connect the PADI to an access point. So far I have not had much luck, the documentation is a little difficult to follow and I have been unable to find an example that I can make work. My current program seems to get stuck when I call wifi_on() My program should print out a value on success or failure but instead it seems to hang. 

Has anyone had success using the WiFi api, or any ideas what might be going wrong? I have successfully used GPIO and Serial, I am using serial currently for simple debugging.

Note: I found an example that looks promising in the component/common/example/wlan_senario but I dont know how to compile and run this example on the padi. I am also confused by the printf statements in the program, where would these messages be printed to when using the PADI?

Any help would be appreciated

many times the printf sends info to serial device[what you use for serial info] but as far as padi you would do best to track down mark and the quickest method is to use the irc chat channel for pine64. easiest way is to click on chat on top of this page, otherwise use chat client.
Update: I have made some progress getting the WiFi api to work/using it, I can scan for networks with the API and connect to a secured access point. I am now running into an issue when trying to get a DHCP IP address.

I have a couple notes in case anyone sees this post and is trying something similar:
1. printf outputs to the UART_LOG serial port NOT the UART2 port that the quick start guide suggests to connect to. I probably should have realized/tried this earlier, but in case anyone else cant figure out where the debug output goes it is the UART_LOG port on the padi pinout diagram.

2. It seems WiFi API calls need to be made from within a task, I don't know if this is something obvious that I missed, but when trying to figure out why code from wifi examples was resulting in a stack overflow while the actual example code ran fine I discovered that the example code was executed from within a vTask. Once I executed my code in a vTask it mostly worked.

I am currently stuck while using LwIP to get a DHCP address, getting some message about being unable to allocate a pbuf for the packet. I will post more details or any solution I find after I have some more time to debug the issue.
Progress Update: We have successfully acquired a DHCP IP address form our router, the issue we ran into with LWIP was that we were missing some initialization functions.

To connect to a wifi network we use the following initialization functions before starting the virtual task from the example sources:
//Initialize console
//Initialize LwIP
//Initialize wifi manager

Now that we are connected and have an IP the next step is to transmit some data over the network. There are a few examples in the 4.0 ameba SDK, but I have been unsuccessful in finding them in the 3.5 SDK. I would use the 4.0 SDK, but for some reason the network adapter seems to shut off when connecting to the Access Point. I am however able to successfully scan nearby networks. For now the plan is to try and port some relevant examples from the 4.0 sdk to the 3.5 sdk. If anyone has input on why we might be having issues with connecting to a network using code that works on the 3.5 sdk in the 4.0 sdk please let me know. Ill try to continue posting updates because it seems like there isn't much documentation for loading code to the PADI and maybe in the future someone will run into similar issues.
I am looking for a small, inexpensive board to be used as a WiFi mesh node, which can also support a simple web server (just file serving only, but with upload capability). Is the PADI a good fit for this project?
(07-28-2018, 02:28 PM)RWK Wrote: I am looking for a small, inexpensive board to be used as a WiFi mesh node, which can also support a simple web server (just file serving only, but with upload capability).  Is the PADI a good fit for this project?

My guess would be that the PADI is too resource constrained for your application. It should be possible to use as a basic webserver and I think there are examples in the SDK, file upload also sounds reasonable. The main problem I see would be that the resources are limited. From the specs you get 1MB ROM, 512KB RAM and 1MB FLASH. If you plan to store files locally then they will have to fit in the available resources. It is possible to add additional memory over an expansion bus, but I suspect a board like the Raspberry Pi Zero W might be more appropriate for your application. I do not know much about mesh networking so I am not sure if the PADI can support that.

Possibly Related Threads...
Thread Author Replies Views Last Post
  Wifi problem at 166Mhz mirecta 5 331 11-14-2017, 02:32 PM
Last Post: Dan

Forum Jump:

Users browsing this thread: 1 Guest(s)