mirror of
https://github.com/Roslund/sthlm-mesh.git
synced 2026-08-10 19:03:21 +02:00
deploy: 9e843f541c
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -10,9 +10,9 @@ Informationen kan sedan visualiseras på karttjänster. Liam Cottles karta visar
|
||||
Neighbor Info Konfiguration Neighbor Info bör endast konfigureras på statiska noder, helst de som har kontakt med många andra noder. För portabla noder som flyttar sig blir Neighbor Info missvisande.</description></item><item><title>Kartor</title><link>https://sthlm-mesh.se/docs/kartor/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sthlm-mesh.se/docs/kartor/</guid><description>Det finns massvis med olika karttjänster, vi rekommenderar Liam Cottles karta: https://meshtastic.liamcottle.net/
|
||||
Uppmärksamma För att tillåta andra noder publicera din nod på kartan behöver lora.config_ok_to_mqtt vara aktiverat. Kartan är ett fantastik verktyg för att analysera meshen, man kan se vart olika noder finns. vilka noder som har vilken roll. Klickar man på en nod och visar detaljer så får man grafer över telemetri. Kartan kan visa vilka noder som har kontakt med vilka genom neighbor info modulen.</description></item><item><title>Solnoder</title><link>https://sthlm-mesh.se/docs/solar_nodes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sthlm-mesh.se/docs/solar_nodes/</guid><description>Att bygga en solnod är både en rolig teknisk utmaning och ett effektivt sätt att förbättra täckningen i meshnätverket. Många platser som är optimala för att placera en nod saknar ofta strömförsörjning. Oavsett om det är på toppen av ett berg eller ett villatak.
|
||||
Kanalen #solar-power på den officiella Discord serven är en bra källa till tips, inspiration och diskussioner.
|
||||
Att bygga en solnod Val av LoRa hårdvara Det är en stor skillnad i strömförbrukning mellan ESP32-baserade och nRF52840-baserade enheter.</description></item><item><title>Communities i Sverige</title><link>https://sthlm-mesh.se/docs/communities/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sthlm-mesh.se/docs/communities/</guid><description>Facebook Grupper Meshtastic Uppsala Meshtastic Gothenburg Meshtastic Östergötland Matrix Meshtastic in Sweden Webbsidor meshat.se sk0qo.se</description></item><item><title>Meddelanden</title><link>https://sthlm-mesh.se/messages/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sthlm-mesh.se/messages/</guid><description>Senaste meddelanden Your browser can not display embedded frames. You can access the embedded page via the following link: https://map.sthlm-mesh.se/api/v1/text-messages/embed?gateway_id=3663385928</description></item><item><title>Meetups</title><link>https://sthlm-mesh.se/meetups/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sthlm-mesh.se/meetups/</guid><description>Kommande Meetups 🍻 Meshtastic AW i Stockholm! 🍻 Träffa likasinnade, snacka LoRa och bygg ut nätverket i Stockholm!
|
||||
Att bygga en solnod Val av LoRa hårdvara Det är en stor skillnad i strömförbrukning mellan ESP32-baserade och nRF52840-baserade enheter.</description></item><item><title>Communities i Sverige</title><link>https://sthlm-mesh.se/docs/communities/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sthlm-mesh.se/docs/communities/</guid><description>Facebook Grupper Meshtastic Uppsala Meshtastic Gothenburg Meshtastic Östergötland Matrix Meshtastic in Sweden Webbsidor meshat.se sk0qo.se</description></item><item><title>Meetups</title><link>https://sthlm-mesh.se/meetups/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sthlm-mesh.se/meetups/</guid><description>Kommande Meetups 🍻 Meshtastic AW i Stockholm! 🍻 Träffa likasinnade, snacka LoRa och bygg ut nätverket i Stockholm!
|
||||
📍 Plats: The Bishops Arms, Sundbyberg
|
||||
📅 Datum: 2025-04-08
|
||||
⏰ Tid: 17:00-21:00 Våren närmar sig och det är massvis med trafik i meshen. Det har dessutom tillkommit massvis med nya noder och personer. Vi bjuder därför in till After Work för de som vill träffa likasinnade, snacka LoRa, dela erfarenheter och visa hemmabyggen.</description></item><item><title>Om STHLM-MESH</title><link>https://sthlm-mesh.se/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sthlm-mesh.se/about/</guid><description>Om STHLM-MESH STHLM-MESH är ett community-drivet open-source-projekt som syftar till att bygga och dokumentera ett öppet LoRa Mesh-nätverk i Stockholm. Projektet drivs av entusiaster som vill utforska möjligheterna med decentraliserad kommunikation och verka för ett välfungerande mesh för alla i Stockholm.
|
||||
Backend Denna webbplats är byggd med de statiska site-generatorn Hugo och använder Docsy som tema.
|
||||
Collaboration Källkoden för webbplatsen är öppen och tillgänglig på GitHub, och vi uppmuntrar bidrag från communityt!</description></item><item><title>Mesh Status</title><link>https://sthlm-mesh.se/status/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sthlm-mesh.se/status/</guid><description>Mesh Status Metrics Grafer och statistik specifikt för Stockholm&rsquo;s meshen. Uppmärksamma Vi hade problem med datainsamlingen den 8/3 vilket påverkar graferna och statistiken. Skapade paket per nod Grafen nedan visar vilka noder som har skickat flest paket under det senaste dygnet. Vidarebefordrade meddelanden och krypterade paket är inte medräknade. Datat i grafen är endast en uppskattning och bör inte ses som exakt. Graferna bygger på MQTT-data från ett begränsat antal noder.</description></item></channel></rss>
|
||||
Collaboration Källkoden för webbplatsen är öppen och tillgänglig på GitHub, och vi uppmuntrar bidrag från communityt!</description></item><item><title>Mesh Status</title><link>https://sthlm-mesh.se/status/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sthlm-mesh.se/status/</guid><description>Mesh Status Metrics Grafer och statistik specifikt för Stockholm&rsquo;s meshen. Uppmärksamma Vi hade problem med datainsamlingen den 8/3 vilket påverkar graferna och statistiken. Skapade paket per nod Grafen nedan visar vilka noder som har skickat flest paket under det senaste dygnet. Vidarebefordrade meddelanden och krypterade paket är inte medräknade. Datat i grafen är endast en uppskattning och bör inte ses som exakt. Graferna bygger på MQTT-data från ett begränsat antal noder.</description></item><item><title>Meddelanden</title><link>https://sthlm-mesh.se/messages/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://sthlm-mesh.se/messages/</guid><description>Senaste meddelanden Alla Ros1 CVK JwK Älg Loading...</description></item></channel></rss>
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
document.addEventListener("DOMContentLoaded", async function () {
|
||||
const messagesContainer = document.getElementById("messages");
|
||||
const radioButtons = document.querySelectorAll("input[name='btnradio']");
|
||||
const loadingDiv = document.getElementById("loading");
|
||||
const messagesList = document.createElement("div");
|
||||
messagesList.style="max-height:70vh;overflow: auto;"
|
||||
messagesContainer.appendChild(messagesList);
|
||||
|
||||
const state = {
|
||||
messages: [],
|
||||
nodesById: {},
|
||||
};
|
||||
|
||||
radioButtons.forEach(radio => {
|
||||
radio.addEventListener("change", fetchMessages);
|
||||
});
|
||||
|
||||
|
||||
async function fetchMessages() {
|
||||
try {
|
||||
let url = "https://map.sthlm-mesh.se/api/v1/text-messages?order=desc";
|
||||
const selectedRadio = document.querySelector("input[name='btnradio']:checked");
|
||||
|
||||
//If all is not selected we get 15 messages. If not we get 35 due to duplicates
|
||||
if (selectedRadio.id !== "all") {
|
||||
url += `&gateway_id=${selectedRadio.id}`;
|
||||
url += `&count=15`;
|
||||
} else {
|
||||
url += `&count=35`;
|
||||
}
|
||||
|
||||
const response = await fetch(url);
|
||||
const data = await response.json();
|
||||
|
||||
//Filter duplicate messages
|
||||
state.messages = Array.from(
|
||||
new Map(data.text_messages.map(msg => [msg.packet_id, msg])).values()
|
||||
);
|
||||
|
||||
// fetch node info
|
||||
for(const message of state.messages){
|
||||
await fetchNodeInfo(message.to);
|
||||
await fetchNodeInfo(message.from);
|
||||
await fetchNodeInfo(message.gateway_id);
|
||||
}
|
||||
|
||||
updateUI();
|
||||
} catch (error) {
|
||||
console.error("Error fetching messages", error);
|
||||
loadingDiv.innerHTML = `<p style="color: red;">Error fetching messages: ${error.message}</p>`;
|
||||
}
|
||||
}
|
||||
async function fetchNodeInfo(nodeId) {
|
||||
// do nothing if already fetched
|
||||
if(nodeId in state.nodesById){
|
||||
return;
|
||||
}
|
||||
|
||||
// do nothing if broadcast address
|
||||
if(nodeId.toString() === "4294967295"){
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(`https://map.sthlm-mesh.se/api/v1/nodes/${nodeId}`);
|
||||
const data = await response.json();
|
||||
const node = data.node;
|
||||
|
||||
if(node){
|
||||
state.nodesById[node.node_id] = node;
|
||||
}
|
||||
|
||||
} catch(e) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function updateUI() {
|
||||
loadingDiv.innerHTML = ""; // Clear the loading message
|
||||
messagesList.innerHTML = "";
|
||||
state.messages.slice().reverse().forEach(message => {
|
||||
const messageDiv = document.createElement("div");
|
||||
messageDiv.className = "d-flex mb-2";
|
||||
messageDiv.innerHTML = `
|
||||
<div class="p-2 flex">
|
||||
<div class="d-flex rounded-circle shadow text-white justify-content-center align-items-center"
|
||||
style="width: 48px; height: 48px; background-color: ${getNodeColour(message.from)}; color: #ffffff;">
|
||||
${getNodeShortName(message.from)}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="small">
|
||||
<a target="_blank" href="https://map.sthlm-mesh.se/?node_id=${message.from}" style="color: grey; text-decoration: none;">${getNodeLongName(message.from)}</a>
|
||||
${message.to !== "4294967295" ? ` → <a target="_blank" href="https://map.sthlm-mesh.se//?node_id=${message.to}" style="color: grey; text-decoration: none;">${getNodeLongName(message.to)}</a>` : ""}
|
||||
</div>
|
||||
<div class="px-2 py-1 pb-1 border rounded shadow-sm" style="background-color: #efefef">
|
||||
<div class="">${escapeMessageText(message.text)}</div>
|
||||
</div>
|
||||
<div class="pt-1" style="font-size: 0.65rem;color: grey;">${formatMessageTimestamp(message.created_at)}</div>
|
||||
</div>
|
||||
|
||||
`;
|
||||
messagesList.appendChild(messageDiv);
|
||||
});
|
||||
messagesList.scrollTop = messagesList.scrollHeight;
|
||||
|
||||
}
|
||||
|
||||
function getNodeColour(nodeId) {
|
||||
return "#" + (nodeId & 0x00FFFFFF).toString(16).padStart(6, '0');
|
||||
}
|
||||
|
||||
function getNodeHexId(nodeId) {
|
||||
return "!" + parseInt(nodeId).toString(16);
|
||||
}
|
||||
|
||||
function getNodeShortName(nodeId) {
|
||||
return state.nodesById[nodeId]?.short_name?.substring(0, 4) ?? "?";
|
||||
}
|
||||
|
||||
function getNodeLongName(nodeId) {
|
||||
return state.nodesById[nodeId]?.long_name ?? getNodeHexId(nodeId);
|
||||
}
|
||||
|
||||
function getNodeName(nodeId) {
|
||||
const node = state.nodesById[nodeId];
|
||||
if(!node){
|
||||
return getNodeHexId(nodeId);
|
||||
}
|
||||
return `[${node.short_name}] ${node.long_name}`;
|
||||
}
|
||||
|
||||
function escapeMessageText(text) {
|
||||
return text.replaceAll('<', '<').replaceAll('>', '>').replaceAll('\n', '<br/>');
|
||||
}
|
||||
|
||||
function formatMessageTimestamp(createdAt) {
|
||||
const date = new Date(createdAt);
|
||||
return date.toLocaleString('sv-SE', { hour12: false }).replace(' ', ' ').slice(0, 16);
|
||||
}
|
||||
|
||||
await fetchMessages();
|
||||
setInterval(fetchMessages, 30000);
|
||||
});
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+10
-2
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://sthlm-mesh.se/docs/settings/</loc><lastmod>2025-02-26T18:39:36+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/device_role/</loc><lastmod>2025-02-26T18:42:15+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/position/</loc><lastmod>2025-02-22T09:11:26+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/mqtt/</loc><lastmod>2025-02-23T20:48:06+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/neighbor_info/</loc><lastmod>2025-02-23T20:48:06+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/kartor/</loc><lastmod>2025-03-08T20:11:28+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/solar_nodes/</loc><lastmod>2025-02-25T20:03:55+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/communities/</loc><lastmod>2025-02-23T20:48:06+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/categories/</loc></url><url><loc>https://sthlm-mesh.se/docs/</loc><lastmod>2025-03-03T22:48:04+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/messages/</loc><lastmod>2025-03-07T21:48:42+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/meetups/</loc><lastmod>2025-03-03T22:48:04+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/about/</loc><lastmod>2025-02-23T18:02:23+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/status/</loc><lastmod>2025-03-08T22:32:18+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/</loc><lastmod>2025-03-09T16:16:44+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/tags/</loc></url></urlset>
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://sthlm-mesh.se/docs/settings/</loc><lastmod>2025-02-26T18:39:36+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/device_role/</loc><lastmod>2025-02-26T18:42:15+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/position/</loc><lastmod>2025-02-22T09:11:26+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/mqtt/</loc><lastmod>2025-02-23T20:48:06+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/neighbor_info/</loc><lastmod>2025-02-23T20:48:06+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/kartor/</loc><lastmod>2025-03-08T20:11:28+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/solar_nodes/</loc><lastmod>2025-02-25T20:03:55+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/docs/communities/</loc><lastmod>2025-02-23T20:48:06+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/categories/</loc></url><url><loc>https://sthlm-mesh.se/docs/</loc><lastmod>2025-03-03T22:48:04+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/meetups/</loc><lastmod>2025-03-03T22:48:04+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/about/</loc><lastmod>2025-02-23T18:02:23+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/status/</loc><lastmod>2025-03-08T22:32:18+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/</loc><lastmod>2025-03-09T16:16:44+01:00</lastmod></url><url><loc>https://sthlm-mesh.se/tags/</loc></url><url><loc>https://sthlm-mesh.se/messages/</loc><lastmod>2025-03-15T23:09:11+01:00</lastmod></url></urlset>
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user