NodeMCU http server stopped working - esp8266

I was successful at running nodemcu-httpserver by Marcos Kirsch on ESP02.
Now I've got a new ESP12e.
I have flushed the same nodemcu and uploaded the same files, same program to it.
But when I run it and call the server, nothing happens. Nothing, like it was not there, yet the device still operates. It can list files, for instance.
Any reason why? Any way to diagnose that?
My current version of firmware is:
NodeMCU custom build by frightanic.com
branch: master
commit: b580bfe79e6e73020c2bd7cd92a6afe01a8bc867
SSL: false
modules: adc,enduser_setup,file,gpio,http,net,node,pwm,spi,tmr,tsl2561,uart,wifi,ws2801
build built on: 2016-07-09 10:38
powered by Lua 5.1.4 on SDK 1.5.1(e67da894)
> = wifi.sta.getip()
192.168.8.104 255.255.255.0 192.168.8.1
> start_httpserver()
nodemcu-httpserver running at http://192.168.8.104:80

Related

Build fails intermittently on Jenkins node machine

I created a build system on windows 2019 server where I installed Jenkins version 2.375.1 and which is running Java 17. I am completely new in this and doing it for first time.
Here is the issue: Whenever I run any job, sometime s(4-6 out of 10) it fails by throwing an exception. See below :
java.nio.channels.ClosedChannelException
at jenkins.agents.WebSocketAgents$Session.closed(WebSocketAgents.java:153)
at jenkins.websocket.WebSockets$1.onWebSocketClose(WebSockets.java:80)
at jenkins.websocket.Jetty10Provider$2.onWebSocketClose(Jetty10Provider.java:149)
at org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler.notifyOnClose(JettyWebSocketFrameHandler.java:308)
at org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler.onClosed(JettyWebSocketFrameHandler.java:292)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.lambda$closeConnection$0(WebSocketCoreSession.java:272)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1450)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1487)
at org.eclipse.jetty.websocket.core.server.internal.AbstractHandshaker$1.handle(AbstractHandshaker.java:212)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.lambda$closeConnection$1(WebSocketCoreSession.java:272)
at org.eclipse.jetty.util.Callback$4.completed(Callback.java:184)
at org.eclipse.jetty.util.Callback$Completing.succeeded(Callback.java:344)
at org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler.onError(JettyWebSocketFrameHandler.java:268)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.lambda$closeConnection$2(WebSocketCoreSession.java:284)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1468)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1487)
............
............
............
And the log I got in node machine on console is :
INFO: Connected
Jan 15, 2023 8:05:02 AM hudson.remoting.UserRequest perform
WARNING: LinkageError while performing
UserRequest:hudson.node_monitors.SwapSpaceMonitor$MonitorTask#4c55cc1c
java.lang.UnsatisfiedLinkError: C:\Users\test*****\AppData\Local\Temp\jna--202642030\jna2121667260400486382.dll: A dynamic link library (DLL) initialization routine failed
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:388)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:232)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:174)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2389)
at java.base/java.lang.Runtime.load0(Runtime.java:755)
at java.base/java.lang.System.load(System.java:1953)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1045)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:1015)
at com.sun.jna.Native.<clinit>(Native.java:221)
at com.sun.jna.Structure.setAlignType(Structure.java:291)
at com.sun.jna.Structure.<init>(Structure.java:208)
at com.sun.jna.Structure.<init>(Structure.java:204)
at com.sun.jna.Structure.<init>(Structure.java:191)
at com.sun.jna.Structure.<init>(Structure.java:183)
at org.jvnet.hudson.Windows$MEMORYSTATUSEX.<init>(Windows.java:67)
Some more info about configuration :
Both controller and node machine is windows server 2019
Since in latest Jenkins the java web connect(Run Jenkins as service on node) is not available so directly running the agent command in node's CLI.
Both controller and node is running Java v17
I went through couple of links and tried all the possible suggestion provided like power management settings on salve machine, increasing Jenkins build timeout settings etc... but no luck.
Any help on this is highly appreciated.
Thanks.
Not sure if there is a bug in Jenkins itself or something. I could not find the answer of the exact issue but after making some changes in jenkins configuration, now i am able to run all the jobs without getting above exception.
Here it is : Earlier i checked jenkins to use websocket in slave configuration. If i just disable it and run then not getting any issue.
Just disbaling this worked for me.. Thanks.

debug openresty with zerobrane

I've followed this tutorial to setting up Zerobrane IDE for debugging openresty:
http://notebook.kulchenko.com/zerobrane/debugging-openresty-nginx-lua-scripts-with-zerobrane-studio.
I installed openresty 1.19.3.1 from a brew formula, and lua scripts are working.
Double checked everything with zerobrane, the error i got:
Debugger server started at vgh.local:8172.
Can't start debugging for '/usr/local/Cellar/openresty/1.19.3.1_1/nginx/lua/content.lua'. Compilation error:
Debugger connection closed
Debugging session completed (traced 0 instructions).
Refused a request to start a new debugging session as there is one in progress already.
What should i check?
This is the conf i have on macos, but i got the same error on a linux (ubuntu 20.10):
lua_package_path '/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/lualibs/?/?.lua;/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/lualibs/?.lua;;';
lua_package_cpath '/Applications/ZeroBraneStudio.app/Contents/ZeroBraneStudio/bin/clibs/?.dylib;;';
You don't say what version of ZeroBrane Studio you are using, but you'll need to use the latest one from the master branch in the repository, as there have been several openresty-related fixes applied to the debugger and merged recently .

Cant upload to the NodeMCU Lua

I have a NodeMCU board running the Lua interpreter, I can access the serial connection via the nodemcu-tool to input commands but when using the nodemcu-tool to upload or reset the filesystem it returns
[NodeMCU-Tool]~ Unable to establish connection
[NodeMCU-Tool]~ Timeout, no response detected - is NodeMCU online and the Lua interpreter ready ?
I might have an answer:
I ran into the same (or very, very similar) problem, on Mac OS X Mojave.
In the end, I reverted to completely uninstalling Node.js (this experience does not help convincing me of Node.js but that is another story) and start from scratch.
Even that did not help because I ran into trouble installing nodemcu-tool ...
Previously I installed it as a global package, and that somehow worked, but it caused me to always sudo my nodemcu-tool invocations - not a good thing!
In any case, sudo-ing plus the commandline parameter "--connection_delay" (or as a project setting, "connectionDelay") helped getting me going.
Until I messed up, and reinstalled everything from scratch. However, the key difference to the instructions for installing nodemcu-tool was adding the '--unsafe-perm' parameter to it, like so:
sudo npm install --unsafe-perm nodemcu-tool -g
That was to be able to get past the repeated installation errors for the serialport package...
IMO, relying on unsafe permissions (for what exactly, anyway!?) is, well, UNSAFE! GRRRRR
To the OP, make sure that:
you have installed Node.js and nodemcu-tool properly (download stable installer etc), and
that you use the --connection_delay parameter in each and every nodemcu-tool invocation!
I had the same problem!
The solution was to reset the board:
Conect the board via USB and press FLASH + RST (two buttons on the board)
relese FLASH
relese RST
Now you can upload your sketch.
If it doesn't work try to disconnect all pins. In my case the GPIO4 was soldered to a LED-Strip and i it was imposible to load the sketch until i disconnected it.

Stack window shows no output when debugging Redis Lua scripts with ZeroBrane

I have followed this tutorial to debug Redis Lua scripts.
https://www.youtube.com/watch?v=7mlajCj4QPw
Everything works except for that the Stack window shows no output so I can't see the value of the variables which is what I need to debug. If I change the Lua interpreter to something else than redis, and try to debug some normal Lua code then it works, and stack window shows everything. But once I switch to Redis as Lua interpreter then nothing shows on the Stack window.
I load up the redis.lua plugin from this repository
as suggested in the video:
https://github.com/pkulchenko/ZeroBranePackage
Stack Window is empty as you can see:
What could be wrong?
Also for some reason when I enter GET foo in the remote console it says:
"Wrong number of args calling Redis command From Lua script"
Since I have redis running on another machine, I thought perhaps I had to change some settings:
debugger.hostname = "192.168.0.161"
debugger.port = 8172
When I try to run it it says:
Can't connect to the debugger at '192.168.0.161:8172': connection refused
Do I have to do something special to the redis settings on my Virtual Linux Box to remote debug Redis? I am using Windows 7 so I can't install Redis 3.2 on it to debug so I have to run it on Cent OS 7 on VirtualBox.
Both of these issues (empty stack window and an error on Redis commands in console) should be fixed in the updated version of Redis plugin (0.33).

Why does the system keep in (CHAOS CALMER)15.05 after upgrading 15.05.1?

I tried many times to upgrade the firmware in both LuCi and SSH as well as the cold reset of the router..
But the information still shows in LuCi,
Hostname OpenWrt
Model Buffalo WZR-HP-G450H
Firmware Version OpenWrt Chaos Calmer 15.05 / LuCI (git-15.248.30277-3836b45)
Kernel Version 3.18.20
It's different from openwrt mentioned 15.05.1 in its main page,
Linux kernel updated to version 3.18.23
...
and one more problem is,
opkg cannot update,
Downloading https://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/base/Packages.gz.
Downloading https://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/base/Packages.sig.
Signature check failed.
Remove wrong Signature file.
...
What's wrong with my updating?

Resources