Difference between revisions of "Guerrilla VoIP"

From Hackerspace ACKspace
Jump to: navigation, search
(added VLAN trick and config generator)
m (typo fix)
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Project
 
{{Project
 +
|Featured=No
 
|State=Active
 
|State=Active
 
|Members=xopr
 
|Members=xopr
 
|Description=low cost communication node
 
|Description=low cost communication node
 +
|Picture=Guerilla_voip_in_use.jpg
 
}}
 
}}
=== synopsis ===
+
== synopsis ==
 
Create a low cost communication node (with VoIP as a base), trying to connect as many as possible types of links, for example:
 
Create a low cost communication node (with VoIP as a base), trying to connect as many as possible types of links, for example:
 
* copper/fibre/WiFi network
 
* copper/fibre/WiFi network
* DECT/POTS telephony
+
* DECT/POTS/GSM telephony
 
* SIP/<abbr title="Skinny Call Control Protocol">SCCP</abbr>
 
* SIP/<abbr title="Skinny Call Control Protocol">SCCP</abbr>
 
* HAM radio (or preferrably, <abbr title="Citizen's Band">CB</abbr> radio: 27MC/PMR)
 
* HAM radio (or preferrably, <abbr title="Citizen's Band">CB</abbr> radio: 27MC/PMR)
Line 24: Line 26:
 
</gallery>
 
</gallery>
  
=== prototyping ===
 
  
So to make the first prototype, I chose the following:
+
== implementation ==
 +
The current version has:
 
* ammo box
 
* ammo box
* 7Ah battery
+
* 7Ah SLA battery
* step-down converter 12->5V
+
* banana/screw terminal
* step-up converter 12v->48V
+
* weatherproof ethernet outlet
* Fritz!Box 7270 (NAT, FxS, FxO, DECT)
+
* 12-volt cigarette lighter receptacle
* two [[Raspberry Pi]]s running FreeSWITCH (external queue, internal SCCP server), DHCP and TFTP
+
* 3D printed insert
 +
* fuse box
 +
* switches for device targeting power and power state preview
 
* Netgear GS110TP (8xPoE + 2xSFP)
 
* Netgear GS110TP (8xPoE + 2xSFP)
 +
* a couple [[Telephone system:Cisco PoE hack]] cable
  
==== Some power tests ====
 
  
 +
=== todo ===
 +
* upload models and schematics
 +
* 3D print inlay for Switch/PI holder
 +
* install fuses and crowbar circuit
 +
* install state leds
 +
* install step-down converter 12->5V
 +
* install step-up converter 12v->48V
 +
* Raspberry PI or Orange PI
 +
* NL dialplan (FS/Cisco)
 +
 +
 +
== prototyping ==
 +
 +
=== hardware ===
 +
 +
==== connectivity/infra ====
 +
{| class="wikitable"
 +
! HW !! price range !! voltage !! power consumption !! copper/Gbit !! PoE !! fibre !! VLAN !! 2.4GHz !! 5GHz !! DSL !! ISDN !! POTS !! DECT !! USB
 +
|-
 +
| [[Fritz!Box]] 7270 || &euro; 50-213 || 5.5-15v || 4.3W - 5.3W || 4/0 ||  ||  || ? || &#x2713; || &#x2713; || &#x2713; || &#x2713; || 2&times;FXS / 1&times;FXO || 5 (6?)<abbr title="handsets">hs</abbr> || 1&times;2.0
 +
|-
 +
| [[GL-Inet]] || &euro;22-30 || 5v || 1W || 2/0 ||  ||  || &#x2713; || &#x2713; ||  ||  ||  ||  ||  || 1&times;2.0
 +
|-
 +
| [[TP WR-703n]] || &euro;17-25 || 5v || 1W || 1/0 ||  ||  || &#x2713; || &#x2713; ||  ||  ||  ||  ||  || 1&times;2.0
 +
|-
 +
| Netgear GS110TP || &euro;126-140 (<abbr title="ordered on amazon.de with discount last May (2017)">&euro;99.64</abbr>) || 48v || 4W || 8/8 || 8 || 2 || &#x2713; ||  ||  ||  ||  ||  ||  ||
 +
|-
 +
| [http://nl.tp-link.com/products/details/cat-41_TL-SG108PE.html TP Link TL-SG108PE] || &euro;65 || 48v || 5.2w || 8/8 || 4 || || &#x2713; || || || || || || ||
 +
|-
 +
| [[Siemens_Gigaset#N510_IP_PRO|Siemens Gigaset N510 IP PRO]] || <abbr title="Bought at broadbandbuyer.co.uk Sep 2016">&pound;53.94</abbr> (&euro;65.39) || 6.5v || 1.2-1.3W || 1/? || <abbr title="supports PoE PD">&#x2713;</abbr> || || &#x2713; ||  ||  ||  ||  ||  || 6<abbr title="handsets">hs</abbr>,4<abbr title="simultaneous calls">sc</abbr> ||
 +
|}
 +
 +
 +
==== hard phones / ATAs ====
 
{| class="wikitable"
 
{| class="wikitable"
! hardware || power source || U || I
+
! HW !! price range !! voltage !! power consumption !! copper/Gbit !! PoE !! VLAN !! SIP !! lines !! extensible !! tested on [[FreeSWITCH]]
 +
|-
 +
| [[Cisco 79xx|Cisco 7905]] || &euro; 10-50 || 48v ||  || 1/0 || &#x2713; || || &#x2713; || 1(?) ||  || &#x2713;
 +
|-
 +
| [[Cisco 79xx|Cisco 7910]] ||  || 48v ||  || 1/0 || &#x2713; || &#x2713; ||  || 6(?) || || &#x2713;
 +
|-
 +
| [[Cisco 79xx|Cisco 7940/7960]] || &euro; 10-50 || 48v || 5W || 2/0 || &#x2713; || &#x2713; || &#x2713; || 2/6 || &#x2713; || &#x2713;
 +
|-
 +
| [[Cisco 79xx|Cisco 7941/7961]] ||  || 48v ||  || 2/2(?) || &#x2713; || &#x2713; || &#x2713;(?) || 2/6 || &#x2713; ||
 +
|-
 +
| [[Avaya 4620SW]] ||  || 48v ||  || 2/0? || &#x2713; || &#x2713;(?) || &#x2713;(?) || ? || &#x2713; ||
 +
|-
 +
| [[Telephone_system:Analog_Telephone_Adapter#Linksys_PAP2T|Linksys PAP2T]] ||  || 5v || 10W || 1/0 || &#x2713; || || &#x2713; || 2&times;FXS ||  || &#x2713;
 +
|-
 +
| [[Telephone_system:Analog_Telephone_Adapter#Sipura_SPA3000|Sipura SPA3000]] ||  || 5v || 7.5W || 1/0 || &#x2713; || || &#x2713; || 1&times;FXS 1&times;FXO ||  || &#x2713;
 +
|}
 +
 
 +
 
 +
=== some power tests ===
 +
 
 +
==== hardware ====
 +
{| class="wikitable"
 +
! hardware || power source || U || I || P<sub>approximated</sub>
 +
|-
 +
| two Raspberry Pis, step down || drill battery pack || 12.6V<sup>[1]</sup> || 330mA || 2&times;2W
 +
|-
 +
| Cisco CP7940, step up || drill battery pack || 12.6V<sup>[1]</sup> || 360mA - 450mA || 5W
 +
|-
 +
| rowspan="2" |Fritz!box (wifi off), direct || rowspan="2" | lab power supply || 12V || 360mA (idle) - 440mA<br/>(42% - 52%, top ~880mA) || 4.3W - 5.3W
 +
|-
 +
| 15V || 250mA (idle) || 3.8W
 +
|-
 +
| Netgear GS110TP PoE, step up || lab power supply || 12V || 330mA || 4W
 +
|-
 +
| Netgear GS110TP PoE +<br/>Cisco CP7940, step up || lab power supply || 12V || 740mA || 9W
 +
|-
 +
| rowspan="2" | Complete set: 2 RasPis,<br/>Fritz!box, switch,<br/>phone + cellphone charging || rowspan="2" | lab power supply || 12V || 2000mA || 24W
 +
|-
 +
| 13.8V || 1600mA || 22W
 
|-
 
|-
| Two Raspberry Pis, step down || drill battery pack || 12V || 330mA
+
| cellphone charging || lab power supply |||||| 5W<sup>[2]</sup>
 
|-
 
|-
| Cisco CP7940, step up || drill battery pack || 12V || 360mA - 450mA
 
 
|-
 
|-
| rowspan="2" |Fritz!box (wifi off), direct || rowspan="2" | lab power supply || 12V || 360mA (idle) - 440mA<br/>(42% - 52%, top ~880mA)
+
| A) Netgear, Pi, 7940, Gl.inet || SLA battery || 12V || || 12W<sup>[3]</sup>
 
|-
 
|-
| 15V || 250mA (idle)
+
| B) Netgear, Pi, 7940, Gl.inet, Gigaset || SLA battery || 12V ||  || 13.3W<sup>[3]</sup>
 
|-
 
|-
| Netgear GS110TP PoE, step up || lab power supply || 12V || 330mA
+
| C) Netgear, Pi, 7940, FritzBox || SLA battery || 12V ||  || 16.3W<sup>[3]</sup>
 +
|}
 +
:<sup>[1]</sup> Approximated by calculating deviation from the lab power supply combined values, which was about 5% off 12V
 +
:<sup>[2]</sup> Approximated by subtracting all calculated items from the complete setup
 +
:<sup>[3]</sup> Approximated by just adding up individual items, using Netgear GS110TP PoE, Raspberry Pi, Gl.inet, Siemens Gigaset N510 and/or Fritz!box
 +
 
 +
==== solar panel and battery ====
 +
Did some rough estimations with a 15 Watt solar panel (using a [https://github.com/apollo-ng/UCSSPM/blob/master/ucsspm.py Unified Clear-Sky Solar Prediction Model script]): on a good summer day it will yield 240W in 17 hours (slightly below 15 megajoule), and on a clear winter day it will yield 25W in 7 hours (630 kilojoule).
 +
 
 +
A 12v SLA battery is full with >12.85V, empty with 12.00V (at 25% capacity) and fully depleted at 11.80V. I came to the conclusion that the effective energy is about 9.5&times;Ah; given a 7Ah battery, this will yield about 66.5Wh.
 +
 
 +
Given the hardware setups described in the [[#hardware_2|previous paragraph]] (note that these values are theoretical maximums):
 +
{| class="wikitable"
 +
! scenario || battery run time || solar+battery run time (winter/summer)
 
|-
 
|-
| Netgear GS110TP PoE +<br/>Cisco CP7940, step up || lab power supply || 12V || 740mA
+
| A || 5:30h || 7:35h/25:30h
 
|-
 
|-
| rowspan="2" | Complete set: 2 RasPis,<br/>Fritz!box, switch,<br/>phone + cellphone charging || rowspan="2" | lab power supply || 12V || 2000mA
+
| B || 5:00h || 6:55h/23:00h
 
|-
 
|-
| 13.8V || 1600mA
+
| C || 4:00h || 5:35h/18:45h
 
|}
 
|}
  
Line 62: Line 150:
 
</gallery>
 
</gallery>
  
==== interesting facts ====
+
=== interesting facts ===
 
* Fritz!box has a switching regulator to 5V tested between 5.5V and 15V (drops off at 5.3V idle and <abbr title="Electrolytic capacitor">elco</abbr> at power supply segment is rated 16V)
 
* Fritz!box has a switching regulator to 5V tested between 5.5V and 15V (drops off at 5.3V idle and <abbr title="Electrolytic capacitor">elco</abbr> at power supply segment is rated 16V)
 
* [[Telephone_system:Cisco PoE hack|PoE hack adapter]] connected pin 1 (white-orange) and pin 3 (white-green) with 22K resistor.
 
* [[Telephone_system:Cisco PoE hack|PoE hack adapter]] connected pin 1 (white-orange) and pin 3 (white-green) with 22K resistor.
Line 68: Line 156:
 
* if you configure the administrative VLAN, the phone will fetch a DHCP lease on that VLAN, allowing you to seperately set up dnsmasq on a Raspberry Pi
 
* if you configure the administrative VLAN, the phone will fetch a DHCP lease on that VLAN, allowing you to seperately set up dnsmasq on a Raspberry Pi
  
=== done ===
 
* the first version works, but still needs some manual labor
 
* [[Telephone system:Cisco PoE hack]] cable
 
* Cisco NL dialplan
 
* tested with battery; float charging device still has to be made (haven't measured how long it would run on a single charge though, but enough time to do some important phone calling)
 
  
Also, I've been playing with the Banana Pi, since the Raspberry Pi sometimes chokes on input digits.
+
== inventory ==
Here is a log/some steps to reproduce
+
* Fritz!Boxes
==== get the basics ====
+
: 7270 (ADSL2+, 1&times;USB 2.0, a/b, S<sub>0</sub> [FXO], 2&times;FXS, S<sub>0</sub>-bus, n&times;DECT, 4&times;100Mbit, 2.4GHz or 5GHz, 64MB RAM)
 +
: 7340 (ADSL2+, VDSL, 2&times;USB 2.0, a/b, S<sub>0</sub> [FXO], 2&times;FXS, n&times;DECT, 2&times;Gbit, 2.4GHz or 5GHz, 128MB RAM)
 +
: 7340 (ADSL2+, VDSL, 2&times;USB 2.0, a/b, S<sub>0</sub> [FXO], 2&times;FXS, S<sub>0</sub>-bus, n&times;DECT, 4&times;100Mbit, 2.4GHz and 5GHz, 512MB RAM)
 +
* DECT phones
 +
: 2&times;Siemens AL28H
 +
: 2&times;Siemens A420 (PsychiC has one)
 +
: 2&times;Philips CD6552B
 +
: 2&times;Philips CD1302S
 +
: 1&times;Philips DECT1221S
 +
: 1&times;Profoon PDX2900
 +
: + what's not yet inventoried at the space
 +
 
 +
 
 +
== log and ideas ==
 +
A list of ideas to consider:
 +
* modular 3D insert for different single board computers
 +
* extra network outlet (since a single one is more or less useless)
 +
* float or CC/CV charger, MPPT solar charger
 +
* external antenna mount
 +
* temperature monitor
 +
 
 +
Here is a log/some steps to reproduce:
 +
 
 +
=== get the basics ===
 
<pre>apt-get install vlan dnsmasq make curl</pre>
 
<pre>apt-get install vlan dnsmasq make curl</pre>
  
==== create and install FreeSWITCH ====
+
 
 +
=== create and install FreeSWITCH ===
 
see https://freeswitch.org/confluence/display/FREESWITCH/Debian#Debian-BuildingFromSource
 
see https://freeswitch.org/confluence/display/FREESWITCH/Debian#Debian-BuildingFromSource
 
<pre>cd /usr/src
 
<pre>cd /usr/src
Line 96: Line 203:
 
chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*</pre>
 
chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*</pre>
  
==== prepare VLAN ====
+
 
 +
=== prepare VLAN ===
 
<pre>modprobe 8021q
 
<pre>modprobe 8021q
 
lsmod | grep 8021q
 
lsmod | grep 8021q
Line 102: Line 210:
 
vconfig set_name_type DEV_PLUS_VID_NO_PAD</pre>
 
vconfig set_name_type DEV_PLUS_VID_NO_PAD</pre>
  
==== set-up network and VLAN ====
+
 
 +
=== set-up network and VLAN ===
 
<pre>vi /etc/network/interfaces</pre>
 
<pre>vi /etc/network/interfaces</pre>
  
Line 125: Line 234:
 
     netmask 255.255.255.0
 
     netmask 255.255.255.0
 
     vlan-raw-device eth0</pre>
 
     vlan-raw-device eth0</pre>
==== dnsmasq ====
+
 
 +
 
 +
=== dnsmasq ===
 
<pre>vi /etc/dnsmasq.conf</pre>
 
<pre>vi /etc/dnsmasq.conf</pre>
  
Line 156: Line 267:
 
<pre>/etc/init.d/dnsmasq restart</pre>
 
<pre>/etc/init.d/dnsmasq restart</pre>
  
==== preconfigure phone ====
+
=== toggleconfig script ===
 +
<pre>#!/bin/bash
 +
 
 +
restart_services()
 +
{
 +
  trap -- SIGHUP SIGINT SIGTERM
 +
 
 +
  service dnsmasq stop > /dev/null
 +
  #nohup sh -c "invoke-rc.d networking stop; sleep 2; invoke-rc.d networking start"
 +
  invoke-rc.d networking stop > /dev/null
 +
  sleep 2
 +
  invoke-rc.d networking start > /dev/null
 +
  service dnsmasq start > /dev/null
 +
 
 +
  trap clean_up SIGHUP SIGINT SIGTERM
 +
}
 +
 
 +
clean_up()
 +
{
 +
  # reset gpio pin and led
 +
  echo "11" > /sys/class/gpio/unexport
 +
  echo 0 > /sys/class/leds/led0/brightness
 +
  echo none > /sys/class/leds/led0/trigger
 +
 
 +
  echo done
 +
  exit
 +
}
 +
 
 +
if [ ! -f /etc/dnsmasq.conf.regular ]; then echo "/etc/dnsmasq.conf.regular does not exist"; exit; fi
 +
if [ ! -f /etc/dnsmasq.conf.config ]; then echo "/etc/dnsmasq.conf.config does not exist"; exit; fi
 +
if [ ! -f /etc/network/interfaces.regular ]; then echo "/etc/network/interfaces.regular does not exist"; exit; fi
 +
if [ ! -f /etc/network/interfaces.config ]; then echo "/etc/network/interfaces.config does not exist"; exit; fi
 +
 
 +
trap clean_up SIGHUP SIGINT SIGTERM
 +
 
 +
echo "11" > /sys/class/gpio/export
 +
echo "in" > /sys/class/gpio/gpio11/direction
 +
 
 +
while true; do
 +
 
 +
  echo "regular mode"
 +
  echo none > /sys/class/leds/led0/trigger
 +
 
 +
  # regular config files
 +
  cp /etc/dnsmasq.conf.regular /etc/dnsmasq.conf
 +
  cp /etc/network/interfaces.regular /etc/network/interfaces
 +
 
 +
  restart_services
 +
 
 +
  while [ `cat /sys/class/gpio/gpio11/value` -gt 0 ]; do
 +
    echo 1 > /sys/class/leds/led0/brightness
 +
    sleep 0.05
 +
    echo 0 > /sys/class/leds/led0/brightness
 +
    sleep 3
 +
  done
 +
 
 +
  echo "config mode"
 +
  echo "heartbeat" > /sys/class/leds/led0/trigger
 +
 
 +
  # regular config files
 +
  cp /etc/dnsmasq.conf.config /etc/dnsmasq.conf
 +
  cp /etc/network/interfaces.config /etc/network/interfaces
 +
 
 +
  restart_services
 +
 
 +
  while [ `cat /sys/class/gpio/gpio11/value` -le 0 ]; do sleep 3; done
 +
 
 +
done</pre>
 +
 
 +
=== preconfigure phone ===
 
* Connect the phone directly using a (optionally crosslink) ethernet cable.
 
* Connect the phone directly using a (optionally crosslink) ethernet cable.
 
* Power the phone, and hold # until the red (mute) light is off and the phone states: "Reset sequence detected"
 
* Power the phone, and hold # until the red (mute) light is off and the phone states: "Reset sequence detected"
Line 168: Line 348:
 
* nohup sh -c "invoke-rc.d networking stop; sleep 2; invoke-rc.d networking start"
 
* nohup sh -c "invoke-rc.d networking stop; sleep 2; invoke-rc.d networking start"
  
=== todo ===
+
== todo ==
 
* work out 'modus operandi': multiple config files switchable by phone
 
* work out 'modus operandi': multiple config files switchable by phone
 
* work on dual linux config with GPIO hardware switch
 
* work on dual linux config with GPIO hardware switch
Line 175: Line 355:
 
* design and create (or buy) small-sized float charger (13.8V 2A) with overcurrent protection, if needed
 
* design and create (or buy) small-sized float charger (13.8V 2A) with overcurrent protection, if needed
  
[[Category:Telephony]]
+
== links ==
 +
Some random links:
 +
* https://www.agentschaptelecom.nl/onderwerpen/telekwetsbaarheid
 +
* https://www.agentschaptelecom.nl/actueel/nieuws/2018/maart/21/zonder-stroom-ook-geen-telecommunicatie
 +
* https://tweakers.net/nieuws/136473/nederlanders-zijn-onvoorbereid-op-uitval-van-communicatie-bij-stroomstoring.html
 +
 
 +
[[Category:Telephony]][[Category:FreeSWITCH]]

Revision as of 10:13, 23 October 2018

Project: Guerrilla VoIP
Featured: No
State Active
Members xopr
GitHub No GitHub project defined. Add your project here.
Description low cost communication node
Picture
Guerilla voip in use.jpg

synopsis

Create a low cost communication node (with VoIP as a base), trying to connect as many as possible types of links, for example:

  • copper/fibre/WiFi network
  • DECT/POTS/GSM telephony
  • SIP/SCCP
  • HAM radio (or preferrably, CB radio: 27MC/PMR)
  • copper/WiFi/USB uplink


It also could need some of the following functionality:

  • PoE service (to drive phones, remote switches/accesspoints)
  • battery supported/powered (in case of power failures/lack of power)
  • Efficient power converter(s) when running on battery
  • sturdy compact waterproof casing


implementation

The current version has:

  • ammo box
  • 7Ah SLA battery
  • banana/screw terminal
  • weatherproof ethernet outlet
  • 12-volt cigarette lighter receptacle
  • 3D printed insert
  • fuse box
  • switches for device targeting power and power state preview
  • Netgear GS110TP (8xPoE + 2xSFP)
  • a couple Telephone system:Cisco PoE hack cable


todo

  • upload models and schematics
  • 3D print inlay for Switch/PI holder
  • install fuses and crowbar circuit
  • install state leds
  • install step-down converter 12->5V
  • install step-up converter 12v->48V
  • Raspberry PI or Orange PI
  • NL dialplan (FS/Cisco)


prototyping

hardware

connectivity/infra

HW price range voltage power consumption copper/Gbit PoE fibre VLAN 2.4GHz 5GHz DSL ISDN POTS DECT USB
Fritz!Box 7270 € 50-213 5.5-15v 4.3W - 5.3W 4/0 ? 2×FXS / 1×FXO 5 (6?)hs 1×2.0
GL-Inet €22-30 5v 1W 2/0 1×2.0
TP WR-703n €17-25 5v 1W 1/0 1×2.0
Netgear GS110TP €126-140 (€99.64) 48v 4W 8/8 8 2
TP Link TL-SG108PE €65 48v 5.2w 8/8 4
Siemens Gigaset N510 IP PRO £53.94 (€65.39) 6.5v 1.2-1.3W 1/? 6hs,4sc


hard phones / ATAs

HW price range voltage power consumption copper/Gbit PoE VLAN SIP lines extensible tested on FreeSWITCH
Cisco 7905 € 10-50 48v 1/0 1(?)
Cisco 7910 48v 1/0 6(?)
Cisco 7940/7960 € 10-50 48v 5W 2/0 2/6
Cisco 7941/7961 48v 2/2(?) ✓(?) 2/6
Avaya 4620SW 48v 2/0? ✓(?) ✓(?) ?
Linksys PAP2T 5v 10W 1/0 2×FXS
Sipura SPA3000 5v 7.5W 1/0 1×FXS 1×FXO


some power tests

hardware

hardware power source U I Papproximated
two Raspberry Pis, step down drill battery pack 12.6V[1] 330mA 2×2W
Cisco CP7940, step up drill battery pack 12.6V[1] 360mA - 450mA 5W
Fritz!box (wifi off), direct lab power supply 12V 360mA (idle) - 440mA
(42% - 52%, top ~880mA)
4.3W - 5.3W
15V 250mA (idle) 3.8W
Netgear GS110TP PoE, step up lab power supply 12V 330mA 4W
Netgear GS110TP PoE +
Cisco CP7940, step up
lab power supply 12V 740mA 9W
Complete set: 2 RasPis,
Fritz!box, switch,
phone + cellphone charging
lab power supply 12V 2000mA 24W
13.8V 1600mA 22W
cellphone charging lab power supply 5W[2]
A) Netgear, Pi, 7940, Gl.inet SLA battery 12V 12W[3]
B) Netgear, Pi, 7940, Gl.inet, Gigaset SLA battery 12V 13.3W[3]
C) Netgear, Pi, 7940, FritzBox SLA battery 12V 16.3W[3]
[1] Approximated by calculating deviation from the lab power supply combined values, which was about 5% off 12V
[2] Approximated by subtracting all calculated items from the complete setup
[3] Approximated by just adding up individual items, using Netgear GS110TP PoE, Raspberry Pi, Gl.inet, Siemens Gigaset N510 and/or Fritz!box

solar panel and battery

Did some rough estimations with a 15 Watt solar panel (using a Unified Clear-Sky Solar Prediction Model script): on a good summer day it will yield 240W in 17 hours (slightly below 15 megajoule), and on a clear winter day it will yield 25W in 7 hours (630 kilojoule).

A 12v SLA battery is full with >12.85V, empty with 12.00V (at 25% capacity) and fully depleted at 11.80V. I came to the conclusion that the effective energy is about 9.5×Ah; given a 7Ah battery, this will yield about 66.5Wh.

Given the hardware setups described in the previous paragraph (note that these values are theoretical maximums):

scenario battery run time solar+battery run time (winter/summer)
A 5:30h 7:35h/25:30h
B 5:00h 6:55h/23:00h
C 4:00h 5:35h/18:45h

interesting facts

  • Fritz!box has a switching regulator to 5V tested between 5.5V and 15V (drops off at 5.3V idle and elco at power supply segment is rated 16V)
  • PoE hack adapter connected pin 1 (white-orange) and pin 3 (white-green) with 22K resistor.
  • if the pre-standard CP-79x0 is connected using the PoE adapter hack, the Netgear GS110TP doesn't power, when you unplug it, it will enable power within 5 seconds; plug in, and the phone boots.
  • if you configure the administrative VLAN, the phone will fetch a DHCP lease on that VLAN, allowing you to seperately set up dnsmasq on a Raspberry Pi


inventory

  • Fritz!Boxes
7270 (ADSL2+, 1×USB 2.0, a/b, S0 [FXO], 2×FXS, S0-bus, n×DECT, 4×100Mbit, 2.4GHz or 5GHz, 64MB RAM)
7340 (ADSL2+, VDSL, 2×USB 2.0, a/b, S0 [FXO], 2×FXS, n×DECT, 2×Gbit, 2.4GHz or 5GHz, 128MB RAM)
7340 (ADSL2+, VDSL, 2×USB 2.0, a/b, S0 [FXO], 2×FXS, S0-bus, n×DECT, 4×100Mbit, 2.4GHz and 5GHz, 512MB RAM)
  • DECT phones
2×Siemens AL28H
2×Siemens A420 (PsychiC has one)
2×Philips CD6552B
2×Philips CD1302S
1×Philips DECT1221S
1×Profoon PDX2900
+ what's not yet inventoried at the space


log and ideas

A list of ideas to consider:

  • modular 3D insert for different single board computers
  • extra network outlet (since a single one is more or less useless)
  • float or CC/CV charger, MPPT solar charger
  • external antenna mount
  • temperature monitor

Here is a log/some steps to reproduce:

get the basics

apt-get install vlan dnsmasq make curl


create and install FreeSWITCH

see https://freeswitch.org/confluence/display/FREESWITCH/Debian#Debian-BuildingFromSource

cd /usr/src
curl https://freeswitch.org/stash/projects/FS/repos/freeswitch/browse/build/Makefile.centos6?raw > Makefile

If you want to compile and install STABLE branch, edit the above Makefile and add " -b v1.4 " just after the word "clone".

make && make install
  • (you can kill time by doing the other chapters)

create user 'freeswitch', add it to group 'daemon' and change owner and group of the freeswitch installation

cd /usr/local
adduser --disabled-password  --quiet --system --home /usr/local/freeswitch --gecos "FreeSWITCH Voice Platform" --ingroup daemon freeswitch
chown -R freeswitch:daemon /usr/local/freeswitch/
chmod -R ug=rwX,o= /usr/local/freeswitch/
chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*


prepare VLAN

modprobe 8021q
lsmod | grep 8021q
echo 8021q >> /etc/modules
vconfig set_name_type DEV_PLUS_VID_NO_PAD


set-up network and VLAN

vi /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0

# dhcp configuration, used in normal operation (this connects to your internet)
iface eth0 inet dhcp

# static ip configuration, used for stand-alone preconfiguring factory-reset phones
#iface eth0 inet static
#	address 192.168.6.1
#	netmask 255.255.255.0
#	gateway 192.168.6.1

# operational VLAN 11 (pick any), for usage with VoIP
auto eth0.11
iface eth0.11 inet static
    address 192.168.11.1
    netmask 255.255.255.0
    vlan-raw-device eth0


dnsmasq

vi /etc/dnsmasq.conf
# uncomment to enable dhcp server on eth0, used for stand-alone preconfiguring factory-reset phones
#interface=eth0
# operational VLAN 11 (pick any), for usage with VoIP
interface=eth0.11

# Choose different ranges for each (V)LAN
dhcp-range=eth0,192.168.6.50,192.168.6.150,12h
dhcp-range=eth0.11,192.168.11.50,192.168.11.150,12h

# Most likeley not needed
#option:tftp-server
#dhcp-option=66,192.168.6.1
#option:
#dhcp-option=150,192.168.178.16

# Enable dnsmasq's built-in TFTP server to serve config files
enable-tftp

# Set the root directory for files available via FTP.
tftp-root=/srv/tftp

Create the /srv/tftp directory and put the configs and firmwares in it. Here is a config generator you can put in there (sorry, can't provide the firmwares since "I don't have them").

service dnsmasq restart

or

/etc/init.d/dnsmasq restart

toggleconfig script

#!/bin/bash

restart_services()
{
  trap -- SIGHUP SIGINT SIGTERM

  service dnsmasq stop > /dev/null
  #nohup sh -c "invoke-rc.d networking stop; sleep 2; invoke-rc.d networking start"
  invoke-rc.d networking stop > /dev/null
  sleep 2
  invoke-rc.d networking start > /dev/null
  service dnsmasq start > /dev/null

  trap clean_up SIGHUP SIGINT SIGTERM
}

clean_up()
{
  # reset gpio pin and led
  echo "11" > /sys/class/gpio/unexport
  echo 0 > /sys/class/leds/led0/brightness
  echo none > /sys/class/leds/led0/trigger

  echo done
  exit
}

if [ ! -f /etc/dnsmasq.conf.regular ]; then echo "/etc/dnsmasq.conf.regular does not exist"; exit; fi
if [ ! -f /etc/dnsmasq.conf.config ]; then echo "/etc/dnsmasq.conf.config does not exist"; exit; fi
if [ ! -f /etc/network/interfaces.regular ]; then echo "/etc/network/interfaces.regular does not exist"; exit; fi
if [ ! -f /etc/network/interfaces.config ]; then echo "/etc/network/interfaces.config does not exist"; exit; fi

trap clean_up SIGHUP SIGINT SIGTERM

echo "11" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio11/direction

while true; do

  echo "regular mode"
  echo none > /sys/class/leds/led0/trigger

  # regular config files
  cp /etc/dnsmasq.conf.regular /etc/dnsmasq.conf
  cp /etc/network/interfaces.regular /etc/network/interfaces

  restart_services

  while [ `cat /sys/class/gpio/gpio11/value` -gt 0 ]; do
    echo 1 > /sys/class/leds/led0/brightness
    sleep 0.05
    echo 0 > /sys/class/leds/led0/brightness
    sleep 3
  done

  echo "config mode"
  echo "heartbeat" > /sys/class/leds/led0/trigger

  # regular config files
  cp /etc/dnsmasq.conf.config /etc/dnsmasq.conf
  cp /etc/network/interfaces.config /etc/network/interfaces

  restart_services

  while [ `cat /sys/class/gpio/gpio11/value` -le 0 ]; do sleep 3; done

done

preconfigure phone

  • Connect the phone directly using a (optionally crosslink) ethernet cable.
  • Power the phone, and hold # until the red (mute) light is off and the phone states: "Reset sequence detected"
  • type 123456789*0#, and when asked to keep network config, choose 2=no
  • once the new firmware is loaded (Freeswitch is not running, so it won't connect), press 'settings' (checkbox button at the bottom right)
  • go to Admin. VLAN ID
  • type **# to unlock the setting, and press 'edit'
  • type in your voice VLAN (11 like the configs say)
  • press validate, and save
  • dnsmasq and interfaces configs can now be restored (no dhcp on eth0, only eth0.11)
  • nohup sh -c "invoke-rc.d networking stop; sleep 2; invoke-rc.d networking start"

todo

  • work out 'modus operandi': multiple config files switchable by phone
  • work on dual linux config with GPIO hardware switch
  • test the fibre ports
  • add homeplug as a proof of concept
  • design and create (or buy) small-sized float charger (13.8V 2A) with overcurrent protection, if needed

links

Some random links: