tomeshnet / prototype-cjdns-pi Goto Github PK
View Code? Open in Web Editor NEWPrototype system for mesh networks on single board computers
Home Page: https://chat.tomesh.net/#/room/#software:tomesh.net
License: GNU General Public License v3.0
Prototype system for mesh networks on single board computers
Home Page: https://chat.tomesh.net/#/room/#software:tomesh.net
License: GNU General Public License v3.0
prometheus-node-exporter is long (esp in the readme)
the program is just called node-exporter
perhaps drop the prometheus part, we don't do prometheus-grafana
thoughts?
During the installation i got an error:
sed: -e expression #1, char 1: unknown command: `,'
Maybe this error comes from a third part software package, but i don't know which package it is.
The trace log show as bellow:
Build completed successfully, type ./cjdroute to begin setup.
Total build time: 176112ms.
Created symlink from /etc/systemd/system/multi-user.target.wants/cjdns.service to /lib/systemd/system/cjdns.service.
Created symlink from /etc/systemd/system/sleep.target.wants/cjdns-resume.service to /lib/systemd/system/cjdns-resume.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/mesh.service to /lib/systemd/system/mesh.service.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
apt-clone archdetect-deb dpkg-repack gir1.2-json-1.0 gir1.2-timezonemap-1.0 gir1.2-xkl-1.0 libdebian-installer4 libparted-fs-resize0
libtimezonemap-data libtimezonemap1 os-prober python3-icu python3-pam rdate
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libnl-route-3-200
The following NEW packages will be installed:
dnsmasq hostapd libnl-route-3-200 radvd
0 upgraded, 4 newly installed, 0 to remove and 345 not upgraded.
Need to get 615 kB of archives.
After this operation, 1,531 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com xenial-updates/universe armhf dnsmasq all 2.75-1ubuntu0.16.04.1 [15.9 kB]
Get:2 http://ports.ubuntu.com xenial/main armhf libnl-route-3-200 armhf 3.2.27-1 [104 kB]
Get:3 http://ports.ubuntu.com xenial/universe armhf hostapd armhf 1:2.4-0ubuntu6 [439 kB]
Get:4 http://ports.ubuntu.com xenial/main armhf radvd armhf 1:2.11-1 [56.0 kB]
Fetched 615 kB in 47s (13.0 kB/s)
Selecting previously unselected package dnsmasq.
(Reading database ... 175211 files and directories currently installed.)
Preparing to unpack .../dnsmasq_2.75-1ubuntu0.16.04.1_all.deb ...
Unpacking dnsmasq (2.75-1ubuntu0.16.04.1) ...
Selecting previously unselected package libnl-route-3-200:armhf.
Preparing to unpack .../libnl-route-3-200_3.2.27-1_armhf.deb ...
Unpacking libnl-route-3-200:armhf (3.2.27-1) ...
Selecting previously unselected package hostapd.
Preparing to unpack .../hostapd_1%3a2.4-0ubuntu6_armhf.deb ...
Unpacking hostapd (1:2.4-0ubuntu6) ...
Selecting previously unselected package radvd.
Preparing to unpack .../radvd_1%3a2.11-1_armhf.deb ...
Unpacking radvd (1:2.11-1) ...
Processing triggers for systemd (229-4ubuntu10) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up dnsmasq (2.75-1ubuntu0.16.04.1) ...
Setting up libnl-route-3-200:armhf (3.2.27-1) ...
Setting up hostapd (1:2.4-0ubuntu6) ...
Setting up radvd (1:2.11-1) ...
dpkg-statoverride: warning: --update given but /var/run/radvd does not exist
Processing triggers for systemd (229-4ubuntu10) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
sed: -e expression #1, char 1: unknown command: `,'
root@my-desktop:~#
Create profile installs for the pi instead of selecting each feature individually
PROFILE=core|default|all|meshstream|experimental
After running for a long time the ramfs log directory gets full
log2ram 50M 50M 0 100% /var/log
PR #106
for some reason dnsmasq does not bind to 10.0.0.1 on boot, but it does after a restart on orange pi in branch.
adding service dnsmasq restart in /etc/rc.local "fixes" it
systemd *.service
files are placed in both:
/lib/systemd/system/
/etc/systemd/system/
Put them in one consistent place.
Latest Arabian for H5 Plus no longer detects hardware because /proc/cpuinfo does not have a hardware field.
Fresh install stretch.
All nodes and peers communicate to each other perfectly. Connect to main node connected to LAN(internet) internet is connected and fine. Connect to any other peer and no internet.
Been running into problems with stretch.
Do I have to turn off "WITH_WIFI_AP" on the peers?
Sorry if noob question, wifi is my nemesis.
Because of the onboard wlan0
on the Pi 3, the mesh script needs to bring up wlan1
instead as the mesh link. That was the only change needed to make the install script work on Pi 3.
Check on state of systemd
services, the mesh0
interface, whether cjdns is running and the currently peered IPv6s. Pretty-print the results. Something like this, but prettier:
$ sudo systemctl -l status mesh.service
$ sudo systemctl -l status cjdns.service
$ ifconfig mesh0
$ nodejs /home/pi/cjdns/tools/peerStats
when running the script with all the optional flags on or going to the directory and manually running the install script in prototype-cjdns-pi2/scripts/ipfs i get
./install: line 18: /usr/local/bin/ipfs: cannot execute binary file: Exec format error
Does this setup run cjdns with SECCOMP disabled or does it enable in the pi?
ASUS USB-N14 (used as Mesh Point interface) seems to make the access point not come up properly unless it is plugged in a few seconds after boot. Probably some variation of #20
Setup:
Ran the following:
$ wget https://raw.githubusercontent.com/tomeshnet/prototype-cjdns-pi2/master/scripts/install && chmod +x install && WITH_IPFS=true ./install
Mesh Interface works fine without IPFS. Also, I haven't tried manually activing the interface after restart.
I had some issues reaching a few websites. @cjdelisle suggested this line of code to fix MSS clamping:
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
The issue generally seems resolved after that, but since I haven't added it to any scripts, I have to run whenever the pi reboots.
Looks like we have most available Pis covered. We should rename the TAG_PROTOTYPE_CJDNS_PI2
to TAG_PROTOTYPE_CJDNS_PI
and consider renaming the repo.
At one of the Install Parties some one had an issue installing prototype on Raspberry pi 2. I dont remember the exact error.
If anyone has a pi 2 can you please try to install develop-beta and confirm if it works or errors out?
This occurs infrequently, but has happened to a few people. Restarting the Pi 3 would fix it.
Serve ipfs over http on the cjdns IPv6, if IPFS is installed:
sudo socat tcp6-listen:80,fork tcp4:0.0.0.0:8080
IPFS content available on: http://[CJDNS_IPV6]/ipfs/IPFS_HASH
Theres no instructions on readme about using the mesh interface
Might also be worth looking into adding an open
option.
Prompt for values of WITH_IPFS
and WITH_WIFI_AP
as part of the script, only if undefined.
Install radvd and in /etc/radvd.conf:
interface wlan0 {
AdvSendAdvert on;
MaxRtrAdvInterval 30;
prefix fdfc::/64
{
AdvOnLink on;
AdvAutonomous on;
};
};
See: https://interfect.github.io/#!/posts/003-Meshnet-Captive-Portal.md
Hi, I tried installing on a fresh raspbian install and got an error during the install. I'm not sure if it's related to grafana but it failed connecting to localhost:3000
.
.
.
Selecting previously unselected package grafana.
(Reading database ... 38934 files and directories currently installed.)
Preparing to unpack .../grafana/tmp/go-grafana.tar.gz ...
Unpacking grafana (4.3.2) ...
Setting up grafana (4.3.2) ...
Adding system user `grafana' (UID 111) ...
Adding new user `grafana' (UID 111) with group `grafana' ...
Not creating home directory `/usr/share/grafana'.
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server
### You can start grafana-server by executing
sudo /bin/systemctl start grafana-server
Processing triggers for systemd (232-25+deb9u1) ...
Synchronizing state of grafana-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable grafana-server
Created symlink /etc/systemd/system/multi-user.target.wants/grafana-server.service → /usr/lib/systemd/system/grafana-server.service.
curl: (7) Failed to connect to localhost port 3000: Connection refused
Related syslog:
.
.
.
Dec 15 00:50:12 rpi3-1 grafana-server[9923]: t=2017-12-15T00:50:12-0500 lvl=info msg="Executing migration" logger=migrator id="create test_data table"
Dec 15 00:50:15 rpi3-1 grafana-server[9923]: t=2017-12-15T00:50:15-0500 lvl=info msg="Created default admin user: admin"
Dec 15 00:50:15 rpi3-1 grafana-server[9923]: t=2017-12-15T00:50:15-0500 lvl=info msg="Starting plugin search" logger=plugins
Dec 15 00:50:15 rpi3-1 grafana-server[9923]: t=2017-12-15T00:50:15-0500 lvl=warn msg="Plugin dir does not exist" logger=plugins dir=/var/lib/grafana/plugins
Dec 15 00:50:15 rpi3-1 grafana-server[9923]: t=2017-12-15T00:50:15-0500 lvl=info msg="Plugin dir created" logger=plugins dir=/var/lib/grafana/plugins
Dec 15 00:50:15 rpi3-1 grafana-server[9923]: t=2017-12-15T00:50:15-0500 lvl=info msg="Initializing Alerting" logger=alerting.engine
Dec 15 00:50:15 rpi3-1 grafana-server[9923]: t=2017-12-15T00:50:15-0500 lvl=info msg="Initializing CleanUpService" logger=cleanup
Dec 15 00:50:15 rpi3-1 grafana-server[9923]: t=2017-12-15T00:50:15-0500 lvl=info msg="Initializing Stream Manager"
Dec 15 00:50:15 rpi3-1 grafana-server[9923]: t=2017-12-15T00:50:15-0500 lvl=info msg="Initializing HTTP Server" logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=
systemctl status grafana-server:
pi@rpi3-1:~ $ sudo systemctl status grafana-server
● grafana-server.service - Grafana instance
Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2017-12-15 00:49:35 EST; 1h 35min ago
Docs: http://docs.grafana.org
Main PID: 9923 (grafana-server)
CGroup: /system.slice/grafana-server.service
└─9923 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile= cfg:default.paths.logs=/var/log/grafana cfg:default.paths.data=/var/lib/grafana cfg:default.paths.plugins=/var/lib/grafana/plugins
after using the script to install cjdns on muliple devices how does one add a peer manually so they can connect over the internet since auto peering only works on local networks
Following changes to assign IPV6 addresses as well over cjdns iptunnel from exit nodes
Needs to be polished and made user friendly. IPV6 addresses here are public addresses i have assigned to me. they are place holders
I used HE's tunnel broker for this
Changes to /usr/local/sbin/cjdns-setup
script
ip addr add 2001:470:b384:1::1/64 dev tun0
ASSIGNED_IP6="2001:470:b384:1::${CLIENT}"
/opt/cjdns/tools/cexec "IpTunnel_allowConnection('${PUBLIC_KEY}',null,64,'${ASSIGNED_IP6}',0,null,'${ASSIGNED_IP}')"
Enable forwarding
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
Other notes for server
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
Add default ipv6 route over tunell at the end
ip -6 route add default dev tun0
A file to explain how to install an orange pi just like rasp in readme
Is the Pi 3 B+ supported?
While the WiFi AP works on most installations, one of the Raspberry Pi's do not see the SSID after each reboot, until manually running sudo service hostapd restart
.
should find a better/more stable bootstrap address for hyperborea only nodes
The ipfs tarball and installation directory still exists after installation. This should be cleaned up after installation with a check to see if ipfs is working.
ipfs cat /ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme
Prompt the user to see if the output looks like:
██║██╔══██╗██╔════╝██╔════╝
██║██████╔╝█████╗ ███████╗
██║██╔═══╝ ██╔══╝ ╚════██║
██║██║ ██║ ███████║
╚═╝╚═╝ ╚═╝ ╚══════╝
If you're seeing this, you have successfully installed
IPFS and are now interfacing with the ipfs merkledag!
Reference problem #119
It might be wise to move the Grafana panel install script into some sort of First Boot mechanism to prevent the error we sometimes get when trying to install it if the service has not yet started during the install.
For WiFi AP and SSH
Uninstall script stops when it cant uninstall ipfs because it was never installed
I get the following error when trying to create an ad-hoc interface:
pi@rpizero1:~ $ set -e
pi@rpizero1:~ $ sudo iw reg set DE
pi@rpizero1:~ $ mesh_dev="wlan0"
pi@rpizero1:~ $ sudo ifconfig $mesh_dev down
pi@rpizero1:~ $ sudo iw $mesh_dev set type ibss
command failed: Device or resource busy (-16)
I am using a Raspberry Pi Zero W(H) with the latest Raspbian Stretch 2018-04-18
Does someone have a solution?
I am not sure which process or something is blocking the interface and already tried to stop wpa_supplicant and dhcpcd. But i was not successful.
Issue: Using Raspberry Pi3B+'s Access point to access a different FC00/8 node
I confined that packets are coming in, and hit the forward chain correctly and look like they are forwarded across the right interface
May 2 03:18:31 tomesh-8668 kernel: [ 2749.468856] IN=wlan-ap OUT=tun0 MAC=b8:27:eb:13:76:3a:44:2c:05:df:98:92:86:dd SRC=fdfc:0000:0000:0000:dd16:d9ce:18f1:341b DST=fcaa:5785:a537:90db:6513:bba9:87a0:12a7 LEN=88 TC=0 HOPLIMIT=127 FLOWLBL=0 PROTO=ICMPv6 TYPE=128 CODE=0 ID=1 SEQ=257
However the packets don't seem to come through the POSTROUTING chain at all.
However I do see some activity for NONE fc00/8 packets on the POSTROUTING chain.
[ 3417.984315] IN= OUT=tun0 SRC=fe80:0000:0000:0000:cef3:1fd3:93b9:f250 DST=ff02:0000:0000:0000:0000:0000:0000:00fb LEN=92 TC=0 HOPLIMIT=1 FLOWLBL=292378 PROTO=UDP SPT=59920 DPT=5353 LEN=52
@claudiobizzotto Should we ask before running rm -rf /home/pi/.ipfs
the same way cjdroute.conf removal is now handled?
Received report that ipfs uninstall does not find ~/.ipfs
until changed to:
if [ -d "$HOME/.ipfs" ]; then
And then:
rm: cannot remove '/home/pi/.ipfs/blocks/...
Owned by root user. Possibly related to #112
It seems that the cjdns performance both with --bench
and iperf3
is far from manually starting it from a fresh Raspbian + cjdns setup: https://github.com/phillymesh/cjdns-optimizations#build-flags-2
It is also unable to saturate a 50 Mbps Mesh Point link.
Issues/Possible Solutions documented for the rt2800usb driver and the Toplinkst
The C.H.I.P. would be a perfect fit for this script as well since it comes with wifi and is quite cheap than a pi2\3
Probably applies to other Orange Pi boards on Armbian too. Running the installation as root
user, IPFS service doesn't start. Suspicion is something wrong here:
https://github.com/tomeshnet/prototype-cjdns-pi/blob/develop/scripts/ipfs/install#L18
https://github.com/tomeshnet/prototype-cjdns-pi/blob/develop/scripts/ipfs/ipfs.service#L8
Current workaround is to manually run this after install and restart the service:
rm -rf /root/.ipfs
ipfs init
As of PR #55 building on the RPi 1 is still broken and I'm worried other builds are not done properly.
It appears that only rhe first arg of $CJDNS_BUILD_FLAGS is being run.
To test on the RPi 1 I ran:
CJDNS_BUILD_FLAGS="Seccomp_NO=1 NO_TEST=1 NO_NEON=1 CFLAGS="-s -static -Wall""
sudo "$CJDNS_BUILD_FLAGS" ./do
And it failed durine tests. Then I ran:
CJDNS_BUILD_FLAGS="NO_TEST=1 Seccomp_NO=1 NO_NEON=1 CFLAGS="-s -static -Wall""
sudo "$CJDNS_BUILD_FLAGS" ./do
And it tried to build without ignoring Seccomp. So, I believe, on the RPi 1and possibly others, only the first build flag is being used. I'd love to hear experiences others have with their Pis of various models.
Like how we have IPFS as an install option, add Patchwork install and run a Pub.
Network Manager does a periodic scan and stalls the WIFI connection every minute for a few seconds.
This can be seen as 0 throughput every minute or periodic high pings (3000-4000 ms) during a ping test
This can also be confirmed through the command
iw event -t
That will identify a scan beginning when the connection stalls
Turning off NetworkManager does fix the issue
Getting rid of NetwokrManager is one option, but i have not found another one yet.
In the long run #93 may be a solution by not relaying on network manager
Install haveged
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.