-
Nodes Nodes and More Nodes
06/24/2015 at 14:04 • 4 commentsI have finally finished hand soldering all the nodes up:
![]()
So where to from here?
I am still making the final feature polishes to the SubPos Node firmware for the PIC (the ESP module firmware for the Node is done). Once that's done I want to get some new performance numbers in controlled conditions and tweak the Android API further.
Having done all that, I will start looking at a revision 2 of the Node PCB as well as a new SubPos receiver device that can use multiple ESP modules for spatial diversity and can be embedded into devices such as drones and the like.
Also stay tuned for a bigger and better demo video shortly.
Edit: Frequency hopping now working in the SubPos Node firmware. The firmware is pretty much complete for the moment.
![]()
Edit 2: Rolling median and averaging filter now implemented in the Android API. Initial tests seem to be giving much better results on distances.
Edit 3: Nodes programmed, stands built to hold nodes off the ground. Ready to do some testing tomorrow in an underground carpark and gather some data. I will be testing 4 nodes in a square arrangement about 6 meters apart from each other with a receiver at .5m intervals. I will then test 8 nodes in an octagon shape. Each test will be performed with both single channel and frequency hopping.
I will post the raw RSSI data as well as the positional data for anyone interested.
-
ESP Receiver Firmware
06/13/2015 at 17:43 • 1 commentEdit: I have converted the firmware that I created before to just output the SPS tagged SSIDs, RSSI and channel as comma separated values instead, as the ESP module doesn't have decent math libraries, doesn't do floating point arithmetic very well and is quite slow to update:
https://github.com/subpos/esp_wifi_scanner
You can use this firmware to do trilateration on another embedded platform. Plus you can possibly use multiple ESP receivers to do multiple scans at once (I will alter this firmware to scan on a GPIO active high shortly so you can trigger a scan).
I am in the process of creating a basic ESP8266 based SubPos receiver (like a GPS receiver module).
An ESP8266 module with the SubPos receiver firmware, will generate NMEA messages based on the currently visible nodes and calculate a position. This position could be used for indoor drones or the like. The ESP module returns a scan once every 2 second or so, so this module might be a little slow for some applications. You could increase this speed by limiting to a single channel to scan.
![]()
![]()
-
SubPos Node Menu
06/09/2015 at 15:39 • 0 commentsI am hammering away at the development of the firmware for the micro on the SubPos Node. I currently have it talking to the ESP module via UART2 and have a user interface with UART1. Implemented as well is a setup wizard and EEPROM storage.
First boot (notice the CRC error at the start; data is stored with a CRC):
SubPos Node - http://www.subpos.org fw ver 0.9.5 2015-06-27 error: eeprom data crc check failed, data not loaded. error: settings data crc check failed, settings not loaded. initialising esp module. menu: help - display this menu message. wizz - guided configuration wizard. show - show current settings. hexd - enter pre coded hex data. dbcn - disable beacons. ebcn - enable beacons. norm - set beacon mode normal. acut - set beacon mode accurate timing. freq - set beacon mode freq hopping (cyclic). slat - set latitude. slng - set longitude. salt - set altitude. clre - clear eeprom. wree - write settings to eeprom. chan - change beacon channel. > show device id : 0 latitude : 0 longitude : 0 altitude : 0 tx power : 0 alt mapping : 0 3d mapping : 0 path loss : 0 reserved : 0 app id : 0 freq hopping : 0 beacon timing: 0 > wizz pressing enter sets 0 enter device id: > 1 enter latitude (-+ to 7 dp): > 10 enter longitude (-+ to 7 dp): > 10 enter altitude (-+ cm relative to sealevel): > 10 enter tx power (-+ dBm to 1 dp): > 10 enable offset mapping (1 or 0): > 0 enable 3d mapping (1 or 0): > 0 enter reserved data (as decimal): > 0 enter application id: > 0 enter path loss co-efficient selection: > 0 done. > show device id : 1 latitude : 100000000 longitude : 100000000 altitude : 10 tx power : 100 alt mapping : 0 3d mapping : 0 path loss : 2 reserved : 0 app id : 0 freq hopping : 0 beacon timing: 0 > wree data written to eeprom. >
Reboot device (CRC check is sucessful and data is loaded into memory):
SubPos Node - http://www.subpos.org fw ver 0.9.5 2015-06-27 eeprom data loaded successfully. settings loaded successfully. initialising esp module. menu: help - display this menu message. wizz - guided configuration wizard. show - show current settings. hexd - enter pre coded hex data. dbcn - disable beacons. ebcn - enable beacons. norm - set beacon mode normal. acut - set beacon mode accurate timing. freq - set beacon mode freq hopping (cyclic). slat - set latitude. slng - set longitude. salt - set altitude. clre - clear eeprom. wree - write settings to eeprom. chan - change beacon channel. > show device id : 1 latitude : 100000000 longitude : 100000000 altitude : 10 tx power : 100 alt mapping : 0 3d mapping : 0 path loss : 2 reserved : 0 app id : 0 freq hopping : 0 beacon timing: 0 > test the thing command_error >
-
SubPos Node ESP Firmware
06/06/2015 at 18:01 • 0 commentsI have released a version of the ESP8266 firmware based on the esp_iot_sdk_v1.1.0_15_05_26 sdk. This firmware adds new Wi-Fi functions that don't write the configuration to flash once changed (more on this later).
These functions are an addition to the AT command set which uses the wifi_softap_set_config_current function that was added in the 1.0.0 SDK:
AT+CWSAPID: Set parameters of AP with exiting password and encryption. AT+CWSAPID=<ssid>,<channel> AT+CWSAPCH: Change AP channel. AT+CWSAPCH=<channel> AT+CWSAPRI: Re-initialises AP. AT+CWSAPRIThe firmware source and binaries are available here.By default, the Makefile is set to build for 512kB flash modules (no "cloud" updating possible). So this should work fine on all ESP modules. This SDK also includes the AT+CWMODE_CUR and AT+CWSAP_CUR AT functions to change further AP modes.
Write eagle.flash.bin to 0x00000 and eagle.irom0text.bin to 0x40000 (if using the nodemcu programmer, program eagle.irom0text.bin first).
Note:
Baudrate = 115200
AT Commands have to be capitalized, and end with "/r/n"![]()
-
SubPos Node v.01a Parts Arrived
05/27/2015 at 12:03 • 0 commentsThe parts for the first run of PCBs have arrived:
![]()
Edit: PCBs arrived!
![]()
Test fit:
![]()
So purple! Thanks hackaday!
Edit2:
I haven't soldered SMD stuff for a while, so I'm definitely out of touch, especially for lead free SMD hand soldering.
The first board is done:
![]()
It all powers up, but I have some programming to do now.
Connecting to MPLAB PICkit 3... Currently loaded firmware on PICkit 3 Firmware Suite Version.....01.36.10 Firmware type..............Enhanced Midrange Now Downloading new Firmware for target device: PIC18F25K22 Downloading AP... AP download complete Programming download... Currently loaded firmware on PICkit 3 Firmware Suite Version.....01.36.10 Firmware type..............PIC18F Target voltage detected Target device PIC18F25K22 found. Device ID Revision = 5 The following memory area(s) will be programmed: program memory: start address = 0x0, end address = 0x7fff configuration memory Device Erased... Programming... Programming/Verify complete
Hello world:
![]()
-
SubPos Android API
05/26/2015 at 12:42 • 0 commentsHere's what some of you have been waiting for, the (rough) Android API has been released! In addition, I have moved the project repositories to github:
In the open source API I have moved to another trilateration library from here. This relies on the org.apache.commons.math3 library to work, so you need to include this library in your project.
This initial release has been adapted from the prototype code that has been worked on so far, so bear with me if there are some errors or omissions, but I have tried to make it simple to use (also removing some of the experimental code until it's tested completely).
To integrate this API into an existing positioning application, all you need to do is create a SubPos object like so:
public class yourClass extends Activity { SubPos subpos; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //Create new SubPos service subpos = new SubPos(this); //"this" passes the activity's context }Then to get your position, call:
SubPosPosition position = subpos.getPosition(); //returns null if position is not calculatedIf you have any thoughts, ideas or fixes, by all means let me know if I have missed something, or if you would like to contribute to the API.Unfortunately, in terms of releasing this on iOS, SubPos will currently not work on a non jailbroken iPhone as they restrict access to the Wi-Fi API. Apple don't even allow Wi-Fi scanning applications (they removed existing ones from the App store too). This is quite a disappointment, considering it is very basic functionality that the hardware is fully capable of supporting. It has also been speculated that this has been done to provide vendor lockin with their iBeacon platform. So while it would be great to get this working on all smartphone platforms, for the moment, unless someone has contacts within Apple to make this happen, it looks like we are stuck with every other device in the world with a Wi-Fi receiver for the time being.
-
Javascript SSID Coder
05/17/2015 at 08:09 • 0 commentsHere is a javascript SSID coder for you to use to use with the Android App:
http://www.subpos.org/index.php?title=Javascript_SSID_Coder
This can now be used in conjunction with ESP8266 node(s) to determine your position.
I will have the Android API released over the next few days along with more documentation (the SubPos standard).
-
PCB Design
05/08/2015 at 07:31 • 3 commentsJust a quick update. About to get these boards made up (a little more tidying to do):
![]()
I have also moved to the Microchip PIC18F25K22-I/SO for this board due to some extra scope creep. Note that these boards are designed to become a self contained system (SubPos Node) that is easy to program and maintain (or use as a GPS position relay). These nodes are also designed to provide accurate timing as well to help with distance calculation accuracy.
If you just want a tiny throwie like device, you can get away with a "pre-programmed" ESP8266 module and a coin cell battery (I will make a variant of this shortly). In this instance, you will need to set the position in the ESP8266 module with AT commands as shown here. On restart (depending on the firmware), the SSID stays stored in the flash on the ESP module. I will have a low power firmware that will work for both the node and throwie types soon.
Edit: I let the integrated antenna design go for the time being and I will use the ESP03 modules instead. I want the final product to integrate all these components individually, but I haven't had the time to go through antenna theory at the moment. These boards are designed for development work.
The "consumer" design will forgo the header arrangement as shown below and opt for a more ruggedised connector setup (reverse voltage protection) and interfacing (e.g. RS232/USB). These boards are already quite small (30.07x32.39 mm), so shrinking them further isn't a priority. If I go down the kickstarter route, I would also like to get FCC approval. No those ESP modules with an FCC logo are NOT FCC approved when they are integrated into a final product (plus it's dubious as to whether those modules are also FCC approved as is anyway). The headers are used to allow for programming of the ESP module flash and general operation.
I am getting these boards made up on http://oshpark.com:
![]()
![]()
Don't worry, your eyes aren't broken. The ICSP connector holes are offset slightly to allow you to plug header pins without soldering.
Just realised the web address will be covered by the ESP03 module once assembled. Oh well :P
-
Positioning Demo
05/03/2015 at 02:58 • 0 commentsHere is a quick and dirty demo video to show off the completed system as it stands so far. The red markers are the known node positions (which are taped to the wall in the video) and the blue marker is the trilaterated position (where the phones are on the table). The nodes themselves are located around the room as you can see in the video.
The node GPS position is "faked" for obvious reasons, but the demo is live. You will also notice at 37 seconds that one of the phones is still waiting to get a beacon frame as the sampling rates differ between phones, but it eventually gets there (as I scroll around you see it go from 3 nodes to 4 nodes and the position then changes). The algorithm itself is performing an averaging function to smooth out the calculated distances from the path loss as well, but you only notice this when moving about.
The position of these nodes is too close to actually be that useful due to the inherent error in the system at the moment (about 1-2 meters so far), I am still working on getting this lowered with faster polling and beacon transmit rates (custom AP firmware) as well as better averaging. I will test more nodes across a larger area as well as more nodes with lower power at some stage when I get some time as well. The current Android application is capable of obtaining a rough position estimate from even just a single node (the position of the node and the radius/error).
Edit: the app binary has been uploaded here if anyone is interested in testing it. I will get an SDK available in the next couple of weeks.
Here is the positioning data I used for those interested, the room I was in is 370x370cm and the GPS coordinates correspond to this:
Square: 370x370cm Elevation 3200cm Window Side NE - A(1) - -37.8107630, 144.9623010 SE - B(2) - -37.8107940, 144.9623150 Kitchen Side NW - C(3) - -37.8107750, 144.9622620 SW - D(4) - -37.8108060, 144.9622760 Device ID : 1 \x53\x50\x53\x01\x01\x01\x69\x76\x09\x12\x56\x67\x7d\x62\x01\x01\x01\x01\x03\x21\x03\x78\x40\x01\x0b\x08\x04\x60\x07\x51\x40 Device ID : 2 \x53\x50\x53\x01\x01\x02\x69\x76\x07\x5c\x56\x67\x7e\x6e\x01\x01\x01\x01\x03\x21\x03\x78\x40\x01\x0b\x01\x04\x60\x07\x51\x21 Device ID : 3 \x53\x50\x53\x01\x01\x03\x69\x76\x08\x1a\x56\x67\x7c\x5c\x01\x01\x01\x01\x03\x21\x03\x78\x40\x01\x0b\x01\x04\x60\x07\x51\x21 Device ID : 4 \x53\x50\x53\x01\x01\x04\x69\x76\x07\x64\x56\x67\x7c\x68\x01\x01\x01\x01\x03\x21\x03\x78\x40\x01\x0b\x08\x04\x60\x07\x51\x40 -
"Augmenting" Existing Access Points
04/26/2015 at 14:52 • 1 commentNow that we have updated the coding schema, we can now make our router accept hex string ASCII SSIDs.
I mentioned earlier that you would be able to convert an existing Wi-Fi access point into a beacon node. I currently own a Billion BiPAC 7800VDPX and will show you how to perform this on it.
This router allows you to set additional SSIDs for a particular Wi-Fi adapter (2.4G) via this page http://192.168.1.254/wlswitchinterface0.wl
You should be able to convert the position coder's hex character output to ASCII characters and copy and paste this into the SSID text field. If you have problems with this, then lets look at the post command for the form:
http://192.168.1.254/wlcfg.wl?wlSsidIdx=0&wlEnableHspot=0&wlEnbl=1&wlHide=0&wlAPIsolation=0&wlSsid=potatoes&wlCountry=AU&wlMaxAssoc=16&wlDisableWme=0&wlEnableWmf=0&wlSsid_wl0v1=wl0_Guest1&wlHide_wl0v1=0&wlAPIsolation_wl0v1=0&wlDisableWme_wl0v1=0&wlEnableWmf_wl0v1=0&wlMaxAssoc_wl0v1=16&wlEnbl_wl0v1=1&wlSsid_wl0v2=wl0_Guest2&wlHide_wl0v2=0&wlAPIsolation_wl0v2=0&wlDisableWme_wl0v2=0&wlEnableWmf_wl0v2=0&wlMaxAssoc_wl0v2=16&wlEnbl_wl0v2=0&wlSsid_wl0v3=wl0_Guest3&wlHide_wl0v3=0&wlAPIsolation_wl0v3=0&wlDisableWme_wl0v3=0&wlEnableWmf_wl0v3=0&wlMaxAssoc_wl0v3=16&wlEnbl_wl0v3=0&wlSyncNvram=1&sessionKey=44797442If we modify the form data object "wlSsid_wl0v1" (this label corresponds with the "name" value of the textbox in the html code) with the following URL coded hex data (note that the Billion terminates its SSID string with the 0x00 null character and also doesn't like the space character, so I had to modify the coder to adjust the bitmask for this value too), we get the following post command:
http://192.168.1.254/wlcfg.wl?wlSsidIdx=0&wlEnableHspot=0&wlEnbl=1&wlHide=0&wlAPIsolation=0&wlSsid=potatoes&wlCountry=AU&wlMaxAssoc=16&wlDisableWme=0&wlEnableWmf=0&wlSsid_wl0v1=%53%50%53%01%01%63%3b%15%0b%07%3b%76%7f%31%07%5b%4d%15%1c%30%07%01%01%21%01%11%30%62%01%07%44&wlHide_wl0v1=0&wlAPIsolation_wl0v1=0&wlDisableWme_wl0v1=0&wlEnableWmf_wl0v1=0&wlMaxAssoc_wl0v1=16&wlEnbl_wl0v1=1&wlSsid_wl0v2=wl0_Guest2&wlHide_wl0v2=0&wlAPIsolation_wl0v2=0&wlDisableWme_wl0v2=0&wlEnableWmf_wl0v2=0&wlMaxAssoc_wl0v2=16&wlEnbl_wl0v2=0&wlSsid_wl0v3=wl0_Guest3&wlHide_wl0v3=0&wlAPIsolation_wl0v3=0&wlDisableWme_wl0v3=0&wlEnableWmf_wl0v3=0&wlMaxAssoc_wl0v3=16&wlEnbl_wl0v3=0&wlSyncNvram=1&sessionKey=44797442Pop that into your web browser and submit it (if it says invalid session key, just ignore it).You will see the new SSIDin the textbox. Make sure Enable is ticked and click Apply. Your new SubPos SSID will be available for positioning.
![]()
Now you might want to restrict connections to that particular SSID, since enabling extra SSIDs on this router also creates an open network. To restrict all devices from connecting, go to the MAC Filter page for that interface:
Once at that page, select "Allow" for "MAC Restrict Mode". This will deny all unless you specify an allowed device in the list.![]()
SubPos is now enabled on your router!
I now get the following decoded data on the updated Android application, which corresponds to the dummy data here:
![]()
Very lots much success!
Blair Wyatt














