{"id":22674543,"url":"https://github.com/afroborg/eitn30-internet-inside","last_synced_at":"2025-03-29T12:21:40.702Z","repository":{"id":239609171,"uuid":"775393254","full_name":"afroborg/eitn30-internet-inside","owner":"afroborg","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-20T11:29:42.000Z","size":523,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T13:23:03.003Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/afroborg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-21T10:00:55.000Z","updated_at":"2024-05-20T11:29:45.000Z","dependencies_parsed_at":"2024-05-13T16:35:59.480Z","dependency_job_id":null,"html_url":"https://github.com/afroborg/eitn30-internet-inside","commit_stats":null,"previous_names":["afroborg/eitn30-internet-inside"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afroborg%2Feitn30-internet-inside","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afroborg%2Feitn30-internet-inside/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afroborg%2Feitn30-internet-inside/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afroborg%2Feitn30-internet-inside/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afroborg","download_url":"https://codeload.github.com/afroborg/eitn30-internet-inside/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246181715,"owners_count":20736610,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-09T17:17:01.662Z","updated_at":"2025-03-29T12:21:40.680Z","avatar_url":"https://github.com/afroborg.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EITN30 - Internet Inside\n\n## Goal\n\nThe goal with the project is create an network interface where IP packets can be sent concurrently between the mobile unit and the base station, with Enhanced ShockBurst™ packets (see the datasheet):\n\n```bash\nping –I longge –c 3 8.8.8.8\n```\n\nwhere:\n\n- `-I \u003cinterface\u003e` is either the interface name or address\n- `-c \u003ccount\u003e` stops after `\u003ccount\u003e` replies\n\nFor our individual goals, see the [individual goals markdown file](/individual-goals.md).\n\n## Quickstart\n\nThe following dependencies are needed:\n\n- \u003chttps://www.gnu.org/software/make/\u003e\n- \u003chttps://github.com/cross-rs/cross\u003e\n\nAnd the following programs are needed:\n\n- [Docker](https://www.docker.com/) (on the development machine)\n- [Tailscale](https://tailscale.com/) (on both Pis and the development machine)\n\n### Library\n\nThe library for the `nRF24l01+` network card is a modified version of [an existing Rust library](https://crates.io/crates/nrf24l01). The following commands should not be needed, however they can sometimes fix a lot of problems if the project is not build correctly:\n\n```bash\ncargo clean       # Clean the project\n\ncd rust-nrf24l01  # Move to the library directory\ncargo clean       # Clean the library\n\ncd ..             # Move back to the root directory\ncargo build       # Build the project\n```\n\nIf that doesn't work either, the library may need to be build after the second `cargo clean` command.\n\n### Build and deploy\n\nThe project code is written in Rust, and is built using `cross` for the `aarch64-unknown-linux-gnu` architecture. Make sure that docker is installed and running.\n\nBuild and deploy the project by running the following commands from the root directory:\n\n```bash\nmake build\n\nmake deploy-mobile  # To deploy only to the mobile unit\nmake deploy-base    # To deploy only to the base station\nmake deploy         # To deploy to both units\n```\n\n### SSH\n\nFor SSH to work both in the lab, and at home, we use [tailscale](https://tailscale.com/). To SSH into a Raspberry Pi, the correct SSH keys are needed. Then run:\n\n```bash\nmake connect-mobile  # To connect to the mobile unit\nmake connect-base    # To connect to the base station\n```\n\n### PI setup\n\n- Enable SPI bus 0 and 1 with 1 CS pin.\n- Add a service file called `longge.service`, corresponding to the content from either the file `deploy/longge-base.service` or `deploy/longge-mobile.service`, depending on what unit is being configured. Then run:\n\n```bash\nsudo systemctl daemon-reload          # To read in the new service file\nsudo systemctl enable longge.service  # To enable autostart\n```\n\nThe service should now start automatically on boot. To start the service manually and check that it is working, you can run:\n\n```bash\nsudo systemctl start longge.service   # To start the service\nsudo systemctl status longge.service  # To check the status\n```\n\nThis will run the `eitn30-internet-inside` script from the `eitn30` directory. The script can also be tested manually by running:\n\n```bash\ncd eitn30        # To move to the eitn30 directory\nmake run-mobile  # On the mobile unit\nmake run-base    # On the base station\n```\n\nDNS must be configured correctly to use longge together with tailscale.\n\n```bash\nsudo nvim /etc/NetworkManager/NetworkManager.conf\n```\n\nAdd the following line to the file:\n\n```bash\ndns=default\n```\n\nThen run the following commands:\n\n```bash\nsudo systemctl restart NetworkManager\nsudo nvim /etc/resolv.conf\n```\n\nAdd the following line to the file\n\n```bash\nnameserver 8.8.8.8\nnameserver 8.8.4.4\n```\n\nThen reboot!\n\n### Development\n\nCI/CD is as simple as rebuilding and redeploying the code!\n\n```bash\nmake build deploy\n```\n\nTo monitor the network traffic on the longge interface, run the following commands of your choice on one of the PIs:\n\n```bash\nsudo tcpdump -i longge  # add dst 10.0.0.\u003ctransmitter_address\u003e to see only received packages, and src 10.0.0.\u003creceiver_address\u003e to see only sent packages\nsudo iptables -S        # to see the iptables rules\nip addr                 # to show all interfaces\nnetstat -r              # to show the routing table\n```\n\n## Devices\n\nThe following components are used in the project:\n\n- 1 Raspberry Pi 5 and 1 Raspberry Pi 4 ([Pinout](https://pinout.xyz/))\n- nRF24L01+ 2.4 GHz Transciever ([Datasheet](https://www.sparkfun.com/datasheets/Components/SMD/nRF24L01Pluss_Preliminary_Product_Specification_v1_0.pdf))\n\nThe transcievers are connected to each Pi as follows:\n\n\u003ccenter\u003e\n\n| inuti24 (Mobile) | SPI bus | SPI device | Device Number | CE GPIO | Position (relative to `inuti24` text) |\n| ---------------- | ------- | ---------- | ------------- | ------- | ------------------------------------- |\n| Transmitter      | 0       | 0          | 1             | 7       | Top                                   |\n| Receiver         | 1       | 0          | 2             | 17      | Bottom                                |\n\n| inuti32 (Base) | SPI bus | SPI device | Device Number | CE GPIO | Position (relative to `inuti24` text) |\n| -------------- | ------- | ---------- | ------------- | ------- | ------------------------------------- |\n| Transmitter    | 0       | 0          | 1             | 17      | Top                                   |\n| Receiver       | 1       | 0          | 2             | 7       | Bottom                                |\n\n\u003c/center\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafroborg%2Feitn30-internet-inside","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafroborg%2Feitn30-internet-inside","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafroborg%2Feitn30-internet-inside/lists"}