Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ The Pi's built-in Wi-Fi is dedicated to the hotspot. If the Pi needs internet te

**Never run `sudo iiab-network` while a USB Wi-Fi adapter is plugged in.** It may move the hotspot onto the adapter. Unplug it first.

### Optional: mesh chat with Meschy

Plug a [Meschy](https://github.com/schematrix/meschy) (or any Meshtastic node) into the Pi and everyone on the hotspot can send and read LoRa mesh messages from a browser, with no Meshtastic app. Messages are saved on the SSD, so people who join later still see the history. LoRa carries short text only; it cannot share Wikipedia pages or maps.

1. Flash Meshtastic on the Meschy and set the region to `EU_868` with the Meshtastic app (see the Meschy README).
2. Plug it into a black USB 2.0 port. Keep the antenna outside any metal case.
3. Install (needs internet once):
```bash
sudo ./scripts/install-meshchat.sh
```
4. Open **http://box.lan/mesh/**. The homepage also gets a "Mesh Sohbet" entry.

Everyone on the page shares the Pi's radio, so each message starts with the sender's nickname. Messages go to the primary channel; direct messages to the Pi's node are shown to everyone on the page. Settings live in `/etc/default/has-meshchat`, logs in `journalctl -u has-meshchat`.

### Repo layout

```
Expand All @@ -82,6 +96,8 @@ scripts/install-homepage.sh installs the custom homepage
config/iiab-overrides.yml Internet-in-a-Box settings
config/content.conf list of content to download
www/home/index.html homepage
scripts/install-meshchat.sh installs the mesh chat bridge (optional)
mesh/ mesh chat service, page, systemd and nginx files
```

### Troubleshooting
Expand Down Expand Up @@ -186,6 +202,20 @@ Pi'nin dahili Wi-Fi kartı sadece hotspot için kullanılıyor. Pi'nin geçici o

**USB Wi-Fi adaptörü takılıyken asla `sudo iiab-network` çalıştırma.** Hotspot'u adaptöre taşıyabilir. Önce adaptörü çıkar.

### İsteğe bağlı: Meschy ile mesh sohbet

Pi'ye bir [Meschy](https://github.com/schematrix/meschy) (ya da herhangi bir Meshtastic cihazı) takarsan, hotspot'a bağlanan herkes Meshtastic uygulaması olmadan tarayıcıdan LoRa mesh ağına mesaj atıp okuyabilir. Mesajlar SSD'ye kaydedilir, sonradan bağlanan da geçmişi görür. LoRa sadece kısa metin taşır; Wikipedia sayfası ya da harita paylaşamaz.

1. Meschy'ye Meshtastic yükle ve Meshtastic uygulamasından bölgeyi `EU_868` yap (Meschy README'sine bak).
2. Siyah USB 2.0 portuna tak. Anten metal bir kasanın içinde kalmasın.
3. Kur (bir kereliğine internet gerekir):
```bash
sudo ./scripts/install-meshchat.sh
```
4. **http://box.lan/mesh/** adresini aç. Ana sayfaya da "Mesh Sohbet" bölümü eklenir.

Sayfadaki herkes Pi'nin radyosunu ortak kullanır, bu yüzden her mesajın başına gönderenin takma adı eklenir. Mesajlar birincil kanala gider; Pi'nin cihazına gelen özel mesajlar sayfadaki herkese görünür. Ayarlar `/etc/default/has-meshchat` dosyasında, kayıtlar `journalctl -u has-meshchat` ile görülür.

### Repo yapısı

```
Expand All @@ -196,6 +226,8 @@ scripts/install-homepage.sh özel ana sayfayı kurar
config/iiab-overrides.yml Internet-in-a-Box ayarları
config/content.conf indirilecek içerik listesi
www/home/index.html ana sayfa
scripts/install-meshchat.sh mesh sohbet köprüsünü kurar (isteğe bağlı)
mesh/ mesh sohbet servisi, sayfası, systemd ve nginx dosyaları
```

### Sorun giderme
Expand Down
24 changes: 24 additions & 0 deletions mesh/has-meshchat.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# HAS_PrepperDisk mesh sohbet ayarları / mesh chat settings
# Değiştirdikten sonra / after editing: sudo systemctl restart has-meshchat

# Seri port. Boş bırakılırsa otomatik bulunur. Birden fazla USB seri cihaz varsa
# /dev/serial/by-id/ altındaki tam yolu yaz.
# Serial port; empty = auto-detect. With several USB serial devices, use the
# full path under /dev/serial/by-id/.
MESHCHAT_DEVICE=

# Mesajların gönderileceği kanal (0 = birincil kanal)
# Channel index to send on (0 = primary channel)
MESHCHAT_CHANNEL=0

# Takma ad dahil en fazla bayt (Meshtastic sınırı ~228)
# Max bytes including the nickname (Meshtastic limit ~228)
MESHCHAT_MAX_BYTES=200

# Aynı cihazdan iki mesaj arasında beklenecek saniye (mesh'i korur)
# Seconds a client must wait between messages (protects the mesh)
MESHCHAT_COOLDOWN=5

MESHCHAT_DB=/library/meshchat/meshchat.db
MESHCHAT_HOST=127.0.0.1
MESHCHAT_PORT=8095
31 changes: 31 additions & 0 deletions mesh/has-meshchat.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[Unit]
Description=HAS_PrepperDisk mesh chat (Meshtastic <-> web bridge)
After=network.target local-fs.target
RequiresMountsFor=/library

[Service]
Type=simple
User=meshchat
Group=meshchat
SupplementaryGroups=dialout
Environment=HOME=/library/meshchat PYTHONUNBUFFERED=1
EnvironmentFile=-/etc/default/has-meshchat
WorkingDirectory=/opt/has-meshchat
ExecStart=/opt/has-meshchat/venv/bin/python /opt/has-meshchat/meshchat.py
Restart=always
RestartSec=5

# Sıkılaştırma / hardening
NoNewPrivileges=yes
PrivateTmp=yes
ProtectSystem=strict
ProtectHome=yes
ReadWritePaths=/library/meshchat
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
RestrictSUIDSGID=yes
LockPersonality=yes

[Install]
WantedBy=multi-user.target
15 changes: 15 additions & 0 deletions mesh/meshchat-nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# HAS_PrepperDisk mesh sohbet: http://box.lan/mesh/ -> 127.0.0.1:8095
# Internet-in-a-Box bu klasördeki dosyaları server bloğunun içine ekler.
# Internet-in-a-Box includes files from /etc/nginx/conf.d inside its server block.
location = /mesh {
return 301 /mesh/;
}
location ^~ /mesh/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_set_header Connection "";
client_max_body_size 8k;
proxy_read_timeout 30s;
proxy_pass http://127.0.0.1:8095/;
}
Loading