Feature #708

Need network config app

Added by Hammel 5 months ago. Updated 3 months ago.

Status:In ProgressStart date:24 Mar 2019
Priority:NormalDue date:
Assignee:Hammel% Done:

40%

Category:-
Target version:v0.1
Severity:03 - Medium

Description

pnc is too big and bulky. I need a C/GTK+ version of imwww, but without AP setup. This doesn't need to be complex. Just set the SSID, password, etc - just like with imwww.</p>

network-config.png - network config imwww (76.3 KB) Hammel, 20 May 2019 19:28

130

History

#1 Updated by Hammel 3 months ago

  • File network-config.png added
  • Status changed from New to In Progress
  • % Done changed from 0 to 10

This is the imwww interface. I just need a GTK+ interface for the upper half, with an additional field for current IP address.

#2 Updated by Hammel 3 months ago

The initial UI is ready. It has a builtin keyboard that was suprisingly easy to write, mostly because of the way I originally wrote the launcher to handle icon touch points. With the keyboard, each touch point is just that much smaller. However, it's only been tested on the desktop. I need to tear down the hardware and add a keyboard so I can get wifi config information to be able to test it on real hardware.

Anyway, the next step should be fairly simple. I need to gather the fields (which is already done in submit()) and pass them to piboxd. The way to do this can be seen in Ironman's imwww/php/settings-write.php:saveWireless(). It looks like this:

$header = 0x00000903;   // MT_NET, MA_SETWIRELESS
$size = strlen($msg);
socket_write($socket, pack("I", $header), 4);
socket_write($socket, pack("I", $size), 4);
socket_write($socket, $msg, strlen($msg));

where msg is a colon seperated set of values, as in:

$msg = $ssid . ":" . $security . ":" . $pw;

The security field can be sent as ordinary text - the backend pnc library handles that.

#3 Updated by Hammel 3 months ago

  • % Done changed from 10 to 40

Actually, I already have an API for this in libpibox: piboxMsg(). There is an example in picam:

piboxMsgSend(MT_STREAM, MA_START, 0, tag, strlen("webcam"), "webcam", NULL, 0);

However, this is for a custom function in picam. The libpibox API is simpler. For xeonnc it would look like this:

(fill buf with colon delimited fields)
piboxMsg(MT_NET, MA_SETWIRELESS, 0, buf, strlen(buf), &returnBuf);

where returnBuf is a pointer to a buffer to hold the returned data. For setting the wireless there is no return data. But we'll also need

  • getWireless - to fill in the fields initially
  • getIP - to get the IP address of the wifi interface

Also available in: Atom PDF