Can't access the meshtastic.local server

I installed the firmware V1.2.11 on a T-beam 1. Manage to get the device to boot setting up a local AP. I use a windows10 PC to logon on to the wifi network, entering password.
However when trying to access the webserver 192.168.42.1 using the Firefox browser nothing happens and after a while I get the error below, I can ping the device on 192.168.42.1.

image

Any idea what could be the issue?

If you update firmware vs overwrite firmware you don’t get some important partitions and files included in newer firmware versions. I’d overwrite instead of trying to flash the individual partitions. See the Common Problems section here How to use "Meshtastic Web" over WiFi · meshtastic/Meshtastic-device Wiki · GitHub

It may be a case of needing to recreate all the partitions, but perhaps try set it to a client on your local wifi and see if that has the same issue.

meshtastic --set wifi_ap_mode false --set wifi_ssid networkname --set wifi_password password

Thanks for the link to the wiki page. After the re-instalation it brought me one step forward, I connect to the webserver but nothing happens when pushing the button “Connect to Meshtastic device”.
image

Try visiting 192.168.42.1/static
From there you can see the available files installed on the web server. It looks like you need to download the latest release of meshtastic-web and upload the files onto the node. The wiki page has a good amount of info on how to do this.

Gave up the local AP approach, connected the device via USB, used the command line tool to setup Wifi credential.
Managed to upload latest index.html, app.js and app.css files to /static and now I can access the web server. The device status works, but not the device settings, here nothing happens.

Ah, I suspect you’re probably using the 1.2.x version on the device which saw quite a few changes from the 1.1.x branch. I don’t think the web side has had an update since then. I believe @sachaw and @crossan007 are working on this though, amongst other things.

1 Like

Yeah, that’s a very old version of the web client. The latest wip one is located at GitHub - sachaw/meshtastic-client

What are the instructions to install the latest wip version?

No direct instructions ATM, we still need to reconfigure the build step to produce only a few artefacts, ATM it produces several files. Feel free to gove it a shot yourself, it’s built with next.js so there’s plenty of support out there. @mc-hamster what do you think about supporting a virtual file system from an archive? I.e. upload an archive and the contents are mapped 1:1 to the web root?

I got as far as cloud hosting before being scared away by vercel. I read to the bottom to see that there is a Static HTML Export.

“(no credit card is required)” gave me pause too lol.

But the static part looks easy enough:

Don’t be scared by vercel, it’s just a free serverless environment, the code can be run anywhere!

I didnt get far at first:

20:23:18	> Build error occurred
20:23:18	/vercel/workpath0/node_modules/@meshtastic/meshtasticjs/dist/index.js:1
20:23:18	import { Client } from "./client";
20:23:18	^^^^^^
20:23:18	SyntaxError: Cannot use import statement outside a module
20:23:18	    at wrapSafe (internal/modules/cjs/loader.js:979:16)
20:23:18	    at Module._compile (internal/modules/cjs/loader.js:1027:27)
20:23:18	    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
20:23:18	    at Module.load (internal/modules/cjs/loader.js:928:32)
20:23:18	    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
20:23:18	    at Module.require (internal/modules/cjs/loader.js:952:19)
20:23:18	    at require (internal/modules/cjs/helpers.js:88:18)
20:23:18	    at Object.luW6 (/vercel/workpath0/.next/server/pages/_app.js:339:18)
20:23:18	    at __webpack_require__ (/vercel/workpath0/.next/server/pages/_app.js:23:31)
20:23:18	    at Module.cha2 (/vercel/workpath0/.next/server/pages/_app.js:146:21)
20:23:18	    at __webpack_require__ (/vercel/workpath0/.next/server/pages/_app.js:23:31)
20:23:18	    at Object.1 (/vercel/workpath0/.next/server/pages/_app.js:99:18)
20:23:18	    at __webpack_require__ (/vercel/workpath0/.next/server/pages/_app.js:23:31)
20:23:18	    at /vercel/workpath0/.next/server/pages/_app.js:91:18
20:23:18	    at Object.<anonymous> (/vercel/workpath0/.next/server/pages/_app.js:94:10)
20:23:18	    at Module._compile (internal/modules/cjs/loader.js:1063:30)

Yikes! This looks like a mess javascript - SyntaxError: Cannot use import statement outside a module - Stack Overflow

I was able to edit meshtastic-client-main/node_modules/@meshtastic/meshtasticjs/package.json and add:
“type”: “module”,
and mv /meshtastic-client-main/node_modules/@meshtastic/meshtasticjs/dist/index.js /meshtastic-client-main/node_modules/@meshtastic/meshtasticjs/dist/index.cjs
then my npm build run worked fine locally, I assume the same would be true up on vercel.

@sachaw , yeah, thats a mess of files to have to upload!

On my local machine, I needed the following to compile\make the ~56 static files:
install node\npm Download | Node.js

npm install -g yarn
npm install -g npm@7.8.0
npm install -g typescript
npm install -g pkg
yarn add --dev typescript @types/react
get https://github.com/sachaw/meshtastic-client
modify line in root of meshtastic-client-main/package.json
“build”: “next build”, to:
“build”: “next build && next export”,
npm run build
edit meshtastic-client-main/node_modules/@meshtastic/meshtasticjs/package.json and add:
“type”: “module”,
mv /meshtastic-client-main/node_modules/@meshtastic/meshtasticjs/dist/index.js /meshtastic-client-main/node_modules/@meshtastic/meshtasticjs/dist/index.cjs
npm run build
output will be in /meshtastic-client-main/out/

So if I understand correctly, if I want to use a functional web interface I should use the 1.1.x branch on the device?

I see the latest 0.1.7 of the meshtastic-web (Feb 19), although the web files are 5 months old so that would be something like Meshtastic-device 1.1.5 beta from October?

It should work with the 1.1.50 version, as there weren’t any significant changes before then I understand. It was working for me on that version.

1 Like

I searched for any other project that has done this and couldn’t find one … are you aware of any examples?

I’m not sure what OS the tbeam is running if any but maybe something like this? GitHub - wagoodman/tar-overlay: A shell script which creates and manages named overlayfs mounts backed by the contents from tar files.

I see it’s esp32 overlay filesystem · Issue #4 · jkent/libespfs · GitHub

Alas, there’s no real operating system on there. It’s a single application running directly on the cpu core.

So the existing app could incorporate the libespfs library to leverage an overlay of sorts? overlay filesystem · Issue #4 · jkent/libespfs · GitHub

At first pass, it looks like it would be possible to use that. :slight_smile: