UPDATE:  "Huge" hardware upgrades!

Finished On-Boot WiFi Connect Debugging

Today I took a quick stab at running through the code of the wifi-pw.py script.

Within a minute or two I noticed that the font file references were relative file references.

So I changed the relative file reference to an absolute file reference by adding "prefix +" before it, where "prefix" = "/root/BeBoXGui/".

 

Example:

font = './font/Font.ttf'              ### The "./" is a relative file path reference

was swithed to..

font = prefix + 'font/Font.ttf'      ### I set the "prefix" as '/root/BeBoXGui' (absolute reference)

 

This fixed the entire script!

Why?

Since the WiFi script is (in this case) launching via "crontab -e", the script wasn't launching because of the relative file reference.

 

Here's a shot of my device running after successfully fixing the scripts:

P4wnS0lo + WiFi: I had some fun with the hardware today too

 

Note:  The actual folder name I used is arbitrary - and "/root/BeBoXGui" is the name of the folder I'm currently working in.

This is the folder name I'm working in because I've unsuccessfully been trying to build my scripts on top of BeBoXGui Kali image - until lately.  Lately I took a few steps back and re-built my OLED P4wnP1 WiFi script package on top of P4wnP1 ALOA.

This is just the BeBoXGui image file without the BeBoXGui scripts.

 

Why BeBoXGui?

My intent by attempting to build from BeBoXGui was to add my scripts to launch before BeBoXGui's gui.py Python script.

So the device would get connected to WiFi on boot - then display BeBoX GUI for P4wnP1 Kali Linux.

But my scripts had too many bugs and errors to simply just switch or add to BeBoXGui.

 

So, taking a few steps back solved everything:

I figured out how to get crontab to automatically run my scripts on boot.

Then I figured out the proper syntax which crontab requires

After putting all of these together, my device now automatically runs all of my WiFi-connect scripts in order.

Here's the flow of the WiFi connect scripts:

If the device finds the previously-saved network in its WiFi network scan, you're prompted to Reconnect.

If the device does NOT find the previously-saved network OR the user says "No - don't reconnect", then the device displays the Select-WiFi-Network screen.

After that, the Enter Password screen appears.

Finally, the script sends the command to connect us to WiFi.

Once connected to WiFi, our device runs a "ping google.com" command to check if we have a solid Internet connection.

Finally, the script asks if we want to Save the WiFi network.

Testing with Previously-Seen & Unseen WiFi Networks

I tested the on-boot WiFi Connect script package by connecting to a previously-unseen WiFi network (with my "saved" WiFi network turned off) - all scripts ran as intended by successfully connecting to my WiFi networks.

One of these tests I performed using a standard WiFi modem/router combo (like you get from your ISP).

The other test was done using my phone's built-in WiFi hotspot.

(I tested the script package's feature to re-connect to a previously saved network by using my phone's WiFi hotspot - and it connected properly.)

TIP:  This seems to be the easiest way to use the WiFi connect script package:

  1. Set up a WiFi hotspot using your phone
  2. When setting up the hotspot, make an easy-to-input password.  This can be a time saver due to the limits of the buttons on the OLED screen.  They're small buttons, so we don't want to spend a ton of time entering really-long WiFi passwords.

Current Contents of OLED-WiFi-P4wnP1 Script Package

Here's a recap / latest rendition of the scripts included in the OLED WiFi Connect package.

 

To do:

10 Ways to Make Code Better

  1. Add more comments
  2. Remove old / extra comments
  3. Consistent file names / variable names (ex: cfg-wifi-wpa.txt, cfg-wifi-ssid.txt, cfg-wifi-ssids.txt)
  4. Remove old files from folder
  5. Explain what the script does at the top of each script
  6. Give a summary of the sections in the script
  7. Add debug / logging lines
  8. Output debug to txt file

 

BIG (Little) Hardware Upgrades!

I finally received my 180 degree USB adapter!  Sweet!

I was excited to receive this because I wanted to plug my OLED P4wnP1 into a power bank without using a cable.  The only way to get this done was to use a "hard" adapter straight out from the power bank.  The right-angle adapters I tried were too big - and left the P4wnP1 dangling about a half inch above the front of the power bank.

That's why I checked out USB 180 degree adapters.  They're perfect for this case - almost:

The clearance on these adapters is not enough to clear most power banks.

BUT - it is enough to clear "ultra thin" power banks.  This means (if the power bank has an equal amount of space between one edge of the USB port and the other edge) that the power bank must be 0.5 inches wide or less.  This is because the USB 180 adapter has roughly 0.25 inches of clearance.

The USB 180 adapter actually has about 0.2 inches of clearance, so feel free to use a small chisel to shave off just a hair of the outer rubber casing on the USB adapter to make that extra 0.05 inches of spaces.  This is officially not recommended since it could technically create a safety concern.  But I'd definitely do it so there's enough clearance - and your OLED P4wnP1 rests flat on the face of your power bank.

My Current OLED P4wnP1 Hardware Setup:

 

Future additions & improvements:

Unu Case from Daddy makes stuff (on Tindie)

2mm x 1mm neodymium magnets - search Amazon for B07RTQW58Z

 

Icon / Logo Concept:

Icon:  Font awesome pawn (fa-chess-pawn)

Hair:   Male short hair silhouette

Device:  Thumb drive icon to resemble an OLED P4wnP1 device / weapon / tool