Deals with output from "meshtastic --info" and sends it to webserver with PHP script, which saves node info into MySQL DB and shows web page with all nodes so far discovered.
Example: https://mesh.tricker.cz/
Meshtastic must be connected to any device which can run Meshtastic Python CLI.
On this server with connected meshtastic device, create script for example in path /home/pi/meshinfo.
In script, change two paths:
/home/pi/meshtastic-infoto file where to save output frommeshtastic --infocommandhttps://your-url.com/index.phpto your server URL where to send data:
#!/bin/bash
/home/pi/.local/bin/meshtastic --info > /home/pi/meshtastic-info
curl -s -F "file=@/home/pi/meshtastic-info" https://your-url.com/index.php >> /dev/nullNow, if you run this script /home/pi/meshinfo (maybe do chmod +x /home/pi/meshinfo first), it should
save output into first path. If so, you can add this script to crontab to run every 15 minutes like:
*/15 * * * * /home/pi/meshinfo >> /dev/nullCreate database access and table with following structure:
CREATE TABLE `Nodes` (
`NodeId` varchar(20) NOT NULL,
`NodeData` text NOT NULL,
PRIMARY KEY (`NodeId`),
UNIQUE KEY `NodeIdUnique` (`NodeId`),
KEY `NodeIdIndex` (`NodeId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;Put index.php file from this repository to your webserver. On top of this file, change configuration -
name of page, allowed IP address to have incoming Meshtastic data and database access.
Script creates and changes files nodes.html and raw-info-data.txt in same directory where index.php is.
Make sure that webserver has write access to this directory or at least this two files.
If all setu up correctly, you should see web page with all nodes discovered so far 🥳