Implementing a time division multiple access scheme for single channel non-LoRaWAN access network, we need to synchronise each transmitter's TX window in order to maximise channel capacity.
We start by working out the TX window length (based on payload, LoRa parameters, receiver gain recovery rate etc). 12 bytes of data allows us lat/long to ~10m precision. vBat to 8 bit resolution plus plus other bytes for general purpose flags.
We then use the Semtech LoRa calculator program to determine a tradeoff between on-air time and SNR margin .
* We want maximum SNR to get the best range.
* We want to minimise on-air time as our trackers are moving, and we want to squeeze as many trackers onto one radio channel as possible.
* We want to minimise bandwidth if possible, are our trackers will have greatly varying temperatures and supply voltages/currents so frequency stability might not be great.
* we want our receiver to be able to recover its AGC circuitry and have sufficient processing power/message buffering queue to be able to pick out successive transmissions (if too closely spaced and densely transmitted, the limiting factor might be our receiver, not our transmitters)
We then decide how often we want to receive position updates - a tradeoff in refresh rate and remote battery life.
We then work out how tight a timing/synchronising loop we can achieve using the available hardware (48MHz onboard clock, GPS PPS synchronisation driving hardware interrupts
We can then design our TDMA scheme around these parameters.
For me, 30 second position updates is more than adequate. I would want to fit around 100 devices on one radio channel.
Rounding numbers up gives us 120 devices transmitting once every 30 seconds, or one transmission every 250 milliseconds.
just your average electronics hobbyist with an interest in AIS, RF telemetry and marine electronics
Monday, 5 September 2016
Monday, 22 August 2016
traccar-web with custom offline maps
(incomplete)
traccar-web interface to traccar.org
* allows URL sign-on and better mobile interface
https://github.com/vitalidze/traccar-web/
get file-roller (archive manager):
sudo apt-get install gnome-common
sudo apt-get install yelp
git clone
https://wiki.gnome.org/Apps/FileRoller
./auto
install traccar.org and traccar-web as per their respective installers - confirm working.
On linux system you can open /opt/traccar/traccar-web.war with archive manager, edit files then re-pack quite easily. https://wiki.gnome.org/Apps/FileRoller (installed default in ubuntu 12.0.4
We are concentrating on the mobile interface
traccar-web.war/m/index.html:
change any references to CDN cloudflare css or js libraries to point to "js/{name of js" or "css/{name..." as required.
then download and add the css or js file to the traccar-web.war/js/ or /css within the archive and re-pack the grml file
...
Thursday, 11 August 2016
raspberry pi lora hoperf python code
clone
https://github.com/mayeranalytics/pySX127x
sudo apt-get install python-dev
https://github.com/mayeranalytics/pySX127x
sudo apt-get install python-dev
wget https://pypi.python.org/packages/source/s/spidev/spidev-3.1.tar.gz
tar xfvz spidev-3.1.tar.gz
cd spidev-3.1
sudo python setup.py install
sudo pip install Adafruit
sudo pip install httplib2
edit files to account for Uputronics Hoperf board#############
pySX127x/SX127x/board_config.py:
line 33 onwards
change pins for the HAB pi board on CE1:
class BOARD:
# Note that the BCOM numbering for the GPIOs is
used.
DIO0 = 16 # RaspPi
GPIO 16 = wpi 27 = phys 36 (input)#dio0 on habboard
# DIO1 = 12 # RaspPi GPIO 12
= wpi 26 = phys 16 (input)DIO5 on habboard
# DIO2 = 24 # RaspPi GPIO 24
= wpi 5 = phys 18 (input)#notused
# DIO3 = 25 # RaspPi GPIO 25
= wpi 6 = phys 22 (input)#notused
LED = 13 # RaspPi
GPIO 23 = wpi 1 = phys 33 ( make output on ‘internet’ LED)
#################
line 74, in def SpiDev(): and change to
BOARD.spi.open (0,1) #for HOPE module at bus CE1
###################
pySX127x/SX127x/LoRaArgumentParser.py
line 41 onwards
change the default= items in the __init__ self section to
the required frequency, spreading factor,bandwidth etc that you are using.
Setting them here for 433MHz board means constructing a LoRa object without all
the parameters will at least work without defaulting to 868mhz. I have mine set
at 434.4mhz
#####################
pySX127x/SX127x/LoRa.py
Line 84 change calibration freq to 433mhz
Line 815 change freq to 433mhz
This just allows the self-test facility to work at 433mhz
without supplying further parameters
remove any initialisations for DIO2 onwards
################
you can now run pySX127x/test_lora.py, to see if
it works. Do a ‘gpio readall’( part of wiringpi) beforehand, which seems to
un-stick it – I guess some wiring pi is not being initialised completely….
#################
I have a blind receiver running continuously, so I just
modify the file pySX127x/rx_cont.py:
Line 44: in function
def on_rx_done(self):
this is where I add my code – and is triggered on each
successful packet reception:IO
installing tilestache on raspberry pi 3
from clean raspbian jessie install
open terminal
sudo pip install tilestache
you may get a warning re compilation terminated, but read it carefully - this is just for C extension speedups which are not compulsory
make directory to serve tiles from and store tilestache
mkdir /home/pi/src/tilestache
create config file as shown in previous posts
sudo nano tilestache.cfg
change hostname of pi:
start tilestache: (assuming your pi is set for hostname pitracker.local)
tilestache-server.py -c /home/pi/src/tilestache/tilestache.cfg -i pitracker.local -p 8080
open terminal
sudo pip install tilestache
you may get a warning re compilation terminated, but read it carefully - this is just for C extension speedups which are not compulsory
make directory to serve tiles from and store tilestache
mkdir /home/pi/src/tilestache
create config file as shown in previous posts
sudo nano tilestache.cfg
change hostname of pi:
start tilestache: (assuming your pi is set for hostname pitracker.local)
tilestache-server.py -c /home/pi/src/tilestache/tilestache.cfg -i pitracker.local -p 8080
Installing traccar.org on raspberry pi 3
from fresh raspbian distribution image
in a terminal
1. expand filesystem and refresh raspbian
raspi-config
follow instructions to expand filesystem to fill SD card
sudo apt-get update
sudo apt-get upgrade
1.a optional - I operate via RDP gui: sudo apt-get install xrdp
2. download traccar.org Linux ARM
currently this version:
https://github.com/tananaev/traccar/releases/download/v3.6/traccar-linux-arm-3.6.zip
extract to e.g. /home/pi/downloads
sudo /home/pi/Downloads/traccar.run
sudo /opt/traccar/bin/traccar start
in a terminal
1. expand filesystem and refresh raspbian
raspi-config
follow instructions to expand filesystem to fill SD card
sudo apt-get update
sudo apt-get upgrade
1.a optional - I operate via RDP gui: sudo apt-get install xrdp
2. download traccar.org Linux ARM
currently this version:
https://github.com/tananaev/traccar/releases/download/v3.6/traccar-linux-arm-3.6.zip
extract to e.g. /home/pi/downloads
sudo /home/pi/Downloads/traccar.run
sudo /opt/traccar/bin/traccar start
Tuesday, 9 August 2016
traccar.org deficiencies
serving traccar.org 3.6 web interface over rpi wifi to mobile device is EXCEEDINGLY slow - read 30 seconds to download all resources, parse java etc on iphone4s.
then, the mobile interface is quite clunky.
given this is a race tracker and the web portal is designed for viewing by general public, we want simple decluttered interface minus logon if possible
traccar.org 3.6 web interface:
pros:
this project using the old traccar.org web interface package seems to be better suited, but isn't ideal either
https://github.com/vitalidze/traccar-web/
pros:
then, the mobile interface is quite clunky.
given this is a race tracker and the web portal is designed for viewing by general public, we want simple decluttered interface minus logon if possible
traccar.org 3.6 web interface:
pros:
- custom map (for serving our own tiles)
- easy to change html source for referencing offline cdn/js libraries without recompiling
cons:
- web interface is slow to load over rpi wifi and iOS
- mobile interface is poorly fitted to mobile canvas size
- no 'show track' easily available
- no 'no logon/auto logon' available
this project using the old traccar.org web interface package seems to be better suited, but isn't ideal either
https://github.com/vitalidze/traccar-web/
pros:
- auto-logon via http get is possible (we can set a landing page on our rpi captive portal to auto log on as guest and go to mobile site
- mobile site is very good on mobile device
- track is shown
- .war file is just a zip - changing code relatively easy
cons
- no custom map layer - will need to recompile .war to add custom map source if possible (replace OSM url's probably...?)
will need to recompile .war each time to make changes to code..- not easy to see where libraries are loaded
- device icons are static, not direction-based arrows
- no track shown in mobile layer
Monday, 8 August 2016
Making Traccar.org server work without internet connection
/opt/traccar/web/release.html:
download all external references to cloudflare CDN for css and java libraries to a new folder:
need to clone extjs/6.0.1/classic/theme-neptune/resources into ajaxlocal
sudo mkdir /opt/traccar/web/ajaxlocal
cd //opt/traccar/web/ajaxlocal
sudo wget http://{cdn css or js library to download}
you will also need to download http://cdnjs.cloudflare.com/ajaz/libjs/extjs/6.0.0/classic/locale/locale-en.js (if this is your chosen language
http://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.1/classic/theme-neptune/resources/theme-neptune-all_1.css
http://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.1/classic/theme-neptune/resources/theme-neptune-all_2.css
theme-neptune-all_1.css
and
theme-neptune-all_2.css
(probably a more elegant way of doing it)
download fontawesome from fontawesome.io version 4.6.3 (or whatever version is called by script - check the debug console of your browser for network resources it tries to load.
extract font-awesome css and font-awesome.min.css into the new /ajaxlocal folder
make a new folder
sudo mkdir /opt/traccar/web/fonts/
extract font-awesome/fonts into /opt/traccar/web/fonts/
cd /opt/traccar/web/fonts
sudo cp /home/pi/Downloads/font-awesome-4.6.3/fonts/* ./
edit /opt/traccar/web/locale.js to point to your ajaxlocal/locale-en.js as downloaded above so the line looks like
Ext.Loader.loadScript('ajaxlocal/locale-' + Locale.languages[Locale.language].code + '.js);
download all external references to cloudflare CDN for css and java libraries to a new folder:
need to clone extjs/6.0.1/classic/theme-neptune/resources into ajaxlocal
sudo mkdir /opt/traccar/web/ajaxlocal
cd //opt/traccar/web/ajaxlocal
sudo wget http://{cdn css or js library to download}
you will also need to download http://cdnjs.cloudflare.com/ajaz/libjs/extjs/6.0.0/classic/locale/locale-en.js (if this is your chosen language
http://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.1/classic/theme-neptune/resources/theme-neptune-all_1.css
http://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.1/classic/theme-neptune/resources/theme-neptune-all_2.css
theme-neptune-all_1.css
and
theme-neptune-all_2.css
(probably a more elegant way of doing it)
download fontawesome from fontawesome.io version 4.6.3 (or whatever version is called by script - check the debug console of your browser for network resources it tries to load.
extract font-awesome css and font-awesome.min.css into the new /ajaxlocal folder
make a new folder
sudo mkdir /opt/traccar/web/fonts/
extract font-awesome/fonts into /opt/traccar/web/fonts/
cd /opt/traccar/web/fonts
sudo cp /home/pi/Downloads/font-awesome-4.6.3/fonts/* ./
edit /opt/traccar/web/locale.js to point to your ajaxlocal/locale-en.js as downloaded above so the line looks like
Ext.Loader.loadScript('ajaxlocal/locale-' + Locale.languages[Locale.language].code + '.js);
Subscribe to:
Posts (Atom)