[Jan 06] Arch Linux (20171225-1) PINE A64(+) Pinebook A64-LTS/SOPINE | [Jan 04] Linux (0.5.15-136) ROCK64 | [Jan 04] Android (20171204) ROCK64 | [Dec 22] Stretch Mate (0.5.15-136-20171222) ROCK64 | [Dec 21] openHAB 2 (v1.4) PINE A64(+) | [Dec 11] Volumio (2.315) PINE A64(+) A64-LTS/SOPINE | [Dec 11] Armbian (5.35) PINE A64(+) Pinebook A64-LTS/SOPINE | [Dec 8] OpenMediaVault (0.5.15-136) ROCK64

Getting Started | Visit the WIKI | 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.

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

Forum Jump:

Users browsing this thread: 1 Guest(s)