GithubHelp home page GithubHelp logo

tomeshnet / prototype-cjdns-pi Goto Github PK

View Code? Open in Web Editor NEW
216.0 20.0 43.0 1.43 MB

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

Shell 65.79% Makefile 2.43% Python 6.73% Dockerfile 0.15% CSS 0.23% JavaScript 23.15% HTML 0.46% Perl 0.77% PHP 0.28%
cjdns raspberry-pi mesh ipfs wifi armbian ssb p2p mesh-networks meshnet

prototype-cjdns-pi's People

Contributors

asotnetworks avatar benhylau avatar claudiobizzotto avatar darkdrgn2k avatar dasanchez avatar dcwalk avatar famicoman avatar garrying avatar jturco32 avatar makew0rld avatar rtreutlein avatar shrinks99 avatar wankyoung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prototype-cjdns-pi's Issues

ipfs installation not working

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

Mesh interface?

Theres no instructions on readme about using the mesh interface

Orange pi H5 Detection

Latest Arabian for H5 Plus no longer detects hardware because /proc/cpuinfo does not have a hardware field.

Not getting through.

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.

Profile Creation

Create profile installs for the pi instead of selecting each feature individually

PROFILE=core|default|all|meshstream|experimental

Cannot uninstall IPFS data directory

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

CJDNS build fails on RPi 1

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.

Mesh Interface Inactive after Installing with IPFS

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.

MSS Clamping

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.

Raspberry pi 3b plus Access point won't nat cjdns

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

Add IPV6 support for CJDNS IPTunnel

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

Server Side

  1. route the /64 used by cjdns iptunnel to the tunnel
 ip addr add 2001:470:b384:1::1/64 dev  tun0
  1. In the loop Generate the assigned address and add it to the allow connections line
   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

Client Side

Add default ipv6 route over tunell at the end

    ip -6 route add default  dev tun0

Scripted diagnostics

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

Installation fails after Grafana is installed

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

config Script TODO

  • Create mesh.conf on startup
  • Migrate ap configuration questions during install
  • Remove hostapd.conf configuration
  • Default config to 80211s
  • Add check if interface has 80211s support
  • Reconfigure interface after config completion
  • Fix boot pause waiting for interface
  • Kill network manager once and for all (move to systemd)
  • swap script to migrate configs between mac
  • add cjdns gateway pinning
  • add eth support for exit/enter node
  • remove hostapd in /etc/systemd/system to allow hostapd@ to work
  • replace hostapd@ startup script to one that checks if it should be a hostapd
  • really.. kill network-manager service
  • correct issues with hostapd not starting correctly

Grafan Install - Better Solution

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.

IPFS http gateway

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

Print access point SSID after install

  • Should only appear if user selects access point with install
  • Might also be helpful to print their IPV6 address as well regardless if they've selected to bring up the AP

Change References of Pi2 to Pi

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.

Clean up after installing ipfs

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!

Add ssbc/patchwork

Like how we have IPFS as an install option, add Patchwork install and run a Pub.

Error when creating ad-hoc interface: command failed: Device or resource busy (-16)

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.

prometheus-node-exporter Rename

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?

NM - Periodic WIFI Scans

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

Dnsmasq does not bind to AP interface

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

how to manually add cjdns peer

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

Make script work for Pi 3

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.

Install on Raspberry Pi 2

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?

package installation failed.

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:~#

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.