the public repo for the e-paper bulletin board. It's a bulletin board that syncs over scuttlebutt :)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
7.8 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. # EBB
  2. ![a photo of the device, made out of multi-colored legos, hanging on a wall](https://git.laboratoryb.org/trav/ebb/raw/branch/master/etc/welcomehome.jpg)
  3. EBB is an e-paper bulletin board that syncs over [Scuttlebutt](https://scuttlebutt.nz) (SSB). EBB is a [Slow Web](https://www.are.na/morgan-sutherland/slow-web) device. As such it is not intended to be *fast*. Thus users must exercise great patience while operating EBB.
  4. ## Usage
  5. Check out the [operators manual (pdf)](http://teafry.me/ebb/operatorsmanual.pdf)
  6. <br>
  7. ## Building one
  8. This program is in alpha so proceed at your own risk :)
  9. ### hardware
  10. recommended hardware components:
  11. | part | cost | link |
  12. | -------- | -------- | -------- |
  13. | 4.2 inch epaper screen | $21 | [waveshare](https://www.waveshare.com/product/modules/oleds-lcds/e-paper/4.2inch-e-paper.htm?SID=U) or [aliexpress](https://www.aliexpress.com/item/32827328059.html?spm=a2g0s.9042311.0.0.349f4c4dYCXYQ3) |
  14. | epaper hat | $10 | [waveshare](https://www.waveshare.com/product/modules/oleds-lcds/e-paper/e-paper-driver-hat.htm?__SID=U) or [aliexpress](https://www.aliexpress.com/item/33007613960.html?spm=a2g0s.9042311.0.0.349f4c4dYCXYQ3) |
  15. | raspberry pi zero w with headers | $14 | [adafruit](https://www.adafruit.com/product/3708) (can only buy 1 at a time) or [pihut](https://www.pishop.us/product/raspberry-pi-zero-wireless-wh-pre-soldered-header/) (can buy more than 1) |
  16. | micro-sd card | variable, $5.8 on amazon | |
  17. | buttons | $7 | https://www.adafruit.com/product/3582 |
  18. | camera | $7 | [aliexpres](https://www.aliexpress.com/item/32788881215.html?spm=a2g0s.12269583.0.0.55eb6619CDSuac) (confirmed works) or [alt-aliexpress](https://www.aliexpress.com/item/32293433078.html?spm=a2g0s.9042311.0.0.349f4c4dYCXYQ3)|
  19. | total: | | $65 plus shipping and tax, ~$75 total |
  20. you'll also need a micro-usb cable, usb power supply and materials to build a case from.
  21. #### assembly
  22. 1. There may be a better way to do this but for now I've been soldering the button shim directly to the Pi using [this pinout](https://pinout.xyz/pinout/button_shim). It can be challenging to solder but not impossible.
  23. 2. Then you just gotta plug in the camera and pop the e-paper hat on top of the headers.
  24. 3. build a case out of lego or something. Have fun with it. I've found it handy to mount the camera to some articulating lego to more easily take pictures of more things.
  25. ### software
  26. 1. download [raspbian lite](https://www.raspberrypi.org/downloads/raspbian/) (or whatever basic raspbian image)
  27. 2. [write the image to your SD card](https://www.raspberrypi.org/documentation/installation/installing-images/)
  28. 3. [Put in wifi credentials into the WPA_supplicant.conf file](https://raspberrypi.stackexchange.com/questions/67649/raspberry-pi-zero-w-headless-using-wpa-supplicant-conf-not-working).
  29. 4. [enable SSH on the device](https://www.raspberrypi.org/documentation/remote-access/ssh/)
  30. 4. put the card in the pi and boot it up
  31. 5. ssh-in (or connect to monitor if you didn't do step 3, connect to monitor/keyboard...)
  32. 6. use `sudo raspi-config` [(howto)](https://www.raspberrypi.org/documentation/configuration/raspi-config.md) to adjust:
  33. - set a new hostname
  34. - enable ssh (if you haven't already)
  35. - change user password
  36. - enable SPI (for e-paper screen)
  37. - enable I2C (for button shim)
  38. - enable camera.
  39. - timezone config
  40. 7. run all this stuff: (this should all be scripted but for now we're setting all these parts up manually...)
  41. ```
  42. sudo apt update -y && sudo apt upgrade -y
  43. sudo apt install unattended-upgrades python-dev python-pip python-buttonshim libjpeg-dev zlib1g-dev git -y
  44. pip install spidev tinydb pillow --no-cache-dir
  45. ```
  46. (third line can take a while...)
  47. Now need to install an ARMv6 compatible NPM. This should work:
  48. ```
  49. curl -o node.tar.gz https://unofficial-builds.nodejs.org/download/release/v13.8.0/node-v13.8.0-linux-armv6l.tar.gz
  50. tar -xzf node.tar.gz
  51. sudo cp -r node-v13.8.0-linux-armv6l/* /usr/local
  52. ```
  53. If that doesn't work you can [read more about installing node on arm v6 architecture](https://www.thepolyglotdeveloper.com/2018/03/install-nodejs-raspberry-pi-zero-w-nodesource/). Also [the builds are here](https://unofficial-builds.nodejs.org/).
  54. <br>
  55. #### clone the repo
  56. ideally right in your home directory.
  57. `git clone https://git.laboratoryb.org/trav/ebb.git`
  58. #### setup SSB
  59. I can't remember how I got ssb-server to work, `sudo npm install -g ssb-server` throws `illegal instruction`. Something to do with a woknky version of Node. So my **extremely** hacky workaround is to unzip `ssb-server.zip` from the install directory into `/usr/local/lib/node_modules/`. This is v bad and needs to be fixed asap. [SSB-server](https://github.com/ssbc/ssb-server) is made available via the MIT licese.
  60. As long as the EBB repo is at `/home/pi/ebb` the following service files should be configured fine. Otherwise you gotta edit ssb.service and ebb-carousel.service and update the `WorkingDirectory` field.
  61. Assuming that's good, from inside the repo run `sudo cp install/ssb.service /etc/systemd/system/ssb.service` and then `sudo systemctl enable ssb.service` to get SSB running (and now it will run at boot). Then run `ssb-server whoami`. This should give you an output like `@b4zcVEqkDe8whateverYntH9d/Qd7jUzpEQ044=.ed25519`. Copy that line (it's your SSB key), we'll need it for the next step...
  62. #### configure config.txt
  63. unless you want to store your images and db in an alternate location, run from inside the repo:
  64. `mkdir ~/images`
  65. `cp install/images/starter.bmp ../images/starter.bmp`
  66. `cp install/configDEFAULT.txt config.txt`
  67. `cp install/posts.json ../posts.json`
  68. replace the values after = with:
  69. * imagesPath = the absolute filepath of where you want to store your images. Ok to leave this as is.
  70. * dbPath = the absolute filepath of where you want to store the database. Ok to leave this as is.
  71. * ssbme = Replace with the key copied in the last step.
  72. #### setup carousel to run at boot
  73. Now we gotta install the service file for the carousel program.
  74. `sudo cp install/ebb-carousel.service /etc/systemd/system/ebb-carousel.service`
  75. `sudo systemctl enable ebb-carousel.service`
  76. ([this page](https://www.raspberrypi.org/documentation/linux/usage/systemd.md) describes what we're doing here.)
  77. #### ssb follows
  78. This part needs a lot of work. To actually sync with another device you're going to need to either run your own pub (I do) or get an invite to a pub. I worry the puny Pi 0 wouldn't be able to handle syncing a ton of people's posts so it seems ideal to run a pub just for syncing EBBs.
  79. Anyway, to connect to other devices you need to run these commands on the command line:
  80. To follow another device:
  81. `ssb-server publish --type contact --contact {@b4zcVEqkDe8-replace-with-your-friend's-key-YntH9d/Qd7jUzpEQ044=.ed25519} --following`
  82. to redeem a pub invite:
  83. `ssb-server invite.accept @b4zcVEqkDe8-replace-with-the-invite-code-YntH9d/Qd7jUzpEQ044=.ed25519`
  84. IN THE FUTURE what I'd like to do is have a button that opens a menu with an option to display a QR code of the SSB key of the device. You could take a picture of it, txt it to a friend, and then they could show the QR code to their device and start following you. This is on the roadmap...
  85. Technically it would probably be very easy to tweak this program to be a general-purpose SSB client but for the time-being I like that it only shows photos from other devices. In the future I may enable it to read and write other kinds of posts (text) to/from SSB.
  86. ## if you managed to get through all that
  87. it should now it be running! If it works well and you're happy and you want to support the development my $ details are [on my website](http://teafry.me/about/). Or if it's not working feel free to send me an email or get in touch on Scuttlebutt, contact details are at that same link. Or you could register an account on git.laboratoryb.org and open an issue?!