Using com2tcp-rfc2217.bat on Windows and uploading to COM5 via WSL2 (ESP8266) and platform.io not working - wsl-2

Setup on Windows
ESP8266 connected to COM5 port
.\com2tcp-rfc2217.bat COM5 4444
D:\Downloads\hub4com-2.1.0.0-386>"hub4com" --create-filter=escparse,com,parse --create-filter=purge,com,purge --create-filter=pinmap,com,pinmap:"--rts=cts --dtr=dsr --break=break" --create-filter=linectl,com,lc:"--br=remote --lc=remote" --add-filters=0:com --create-filter=telnet,tcp,telnet:" --comport=server --suppress-echo=yes" --create-filter=lsrmap,tcp,lsrmap --create-filter=pinmap,tcp,pinmap:"--cts=cts --dsr=dsr --dcd=dcd --ring=ring" --create-filter=linectl,tcp,lc:"--br=local --lc=local" --add-filters=1:tcp --baud=115200 --octs=off "COM5" --use-driver=tcp "*4444"
COM5 Open("COM5", baud=115200, data=8, parity=no, stop=1, octs=off, odsr=off, ox=off, ix=off, idsr=off, ito=0) - OK
Route data TCP(1) --> COM5(0)
Route data COM5(0) --> TCP(1)
Route flow control TCP(1) --> COM5(0)
Route flow control COM5(0) --> TCP(1)
Filters:
_______
\->{telnet.IN}-------------------------------------------->
TCP(1) | /
_______/<-----{telnet.OUT}<-{lsrmap.OUT}<-{pinmap.OUT}<-{lc.OUT}<-
________
\->{parse.IN}------------------------------>
COM5(0) | /
________/<-----{purge.OUT}<-{pinmap.OUT}<-{lc.OUT}<-
Started COM5(0)
Socket(0.0.0.0:4444) = 204
Listen(204) - OK
Started TCP(1)
Setup on WSL2
VSCode Remote for WSL installed and running fine
platform.io extension in VSCode installed and running
platformio.ini
[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
platform_packages =
framework-arduinoespressif8266 # https://github.com/esp8266/Arduino.git
lib_deps = ESP Async WebServer
build_unflags = -std=gnu++17 -std=c17
build_flags = -std=gnu99 -std=c++11
monitor_port=socket://192.168.1.100:4444
monitor_speed=115200
upload_speed=115200
upload_port=socket://192.168.1.100:4444
Problem
I cannot upload anything to the ESP8266
Connecting........_____
When using upload_port=rfc2217://192.168.1.100:4444 the error is:
A fatal error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
When using upload_port=socket://192.168.1.100:4444the error is:
A fatal error occurred: Failed to connect to ESP8266: Invalid head of packet (0x6F)
What works
I can open up the serial monitor and view the serial output of the ESP8266 just fine. So the ports and the baud-rates seem fine to me.
What am I missing here?

I managed to solve it.
For some reason, the ESP8266 is not automatically switching to flash-mode while uploading via rfc2217. I had to put it in flash-mode manually by holding flash-button and pressing reset button while the Connecting...___ shows up.

Related

NUCLEO-F411RE Openocd "Cannot identify target as a STM32 family."

Nucleo with STM32F103RB
STM32F3DISCOVERY
Nucleo with STM32F411RE
I am currently trying to learn rust embedded thanks to 3 stm32 based developpement board :
I have no issue with the first two ones but I can not make work the F411RE with gdb & openocd. Everytime I try to flash (the same program that works fine with the two others) I receive this :
Openocd :
`
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1000 kHz
Info : STLINK V2J33M25 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.261538
Info : stm32f3x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f3x.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : device id = 0x10006431
Warn : Cannot identify target as a STM32 family.
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected`
`
As you can see my board is detected but as soon as I try to connect to GDB, the board is not recognized.
Just so that you can check memory parameter :
`
FLASH : ORIGIN = 0x08000000, LENGTH = 512K
RAM : ORIGIN = 0x20000000, LENGTH = 128K
`
I don't really know what to do knowing that it works very well on an other nucleo with an ARM cortex M3 and also with an other board but this time with an ARM cortex M4F.
Thank you for your help

Open web video with nodejs

Hi i'm trying to build a nodejs app on my raspberry pi model 4 that after receiving an input (nfc tag)
open a url that contain a video.
Es 'http://www.example.com/webapi/content?rfid=05:66:77:66:93:67'.
The problem is that when i try to open my link with vlc or omxplayer it drop an error and doesn't show me any video. I try to put the link in the "open network stream" on vlc in windows and i have the same issue, but if i put the link in the browser I see the video correctly. If i try to open other videos i didn't get any problem.
Unfortunately I can't post the link to the site for privacy reasons. Any advice on what the problem might be?
Error log on raspberry pi:
[01cf9b80] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[01d089f0] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[01d089f0] main interface error: no suitable interface module
[01c72b58] main libvlc error: interface "dbus,none" initialization failed
[01d152c0] main interface error: no suitable interface module
[01c72b58] main libvlc error: interface "globalhotkeys,none" initialization failed
[01c72b58] main libvlc: Esecuzione di vlc con l'interfaccia predefinita. Usa 'cvlc' per utilizzare vlc senza interfaccia.
error: XDG_RUNTIME_DIR not set in the environment.
[01d152c0] skins2 interface error: cannot initialize OSFactory
[01d152c0] [cli] lua interface: Listening on host "*console".
VLC media player 3.0.8 Vetinari
Command Line Interface initialized. Type `help' for help.
> [b1002098] mp4 stream error: no moov before mdat and the stream is not seekable
[b1001e58] prefetch stream error: cannot seek (to offset 48)
[b1054990] mmal_codec decoder: VCSM init succeeded: CMA
[mov,mp4,m4a,3gp,3g2,mj2 # 0xb104e340] stream 0, offset 0x4d3: partial file

NWJS (Node Webkit) app is not responding on Linux systems when I use it with Web Workers

NWJS Version: v.0.32.1 (Tested on different 0.31 versions also and 0.32.beta)
Operating System: Linux only. Tested on Ubuntu 16.04 LTS x64 and Elementary OS 0.4.1 Loki x64
Expected behaviour
The program must respond.
Actual behaviour
The program not responding and if I break it (Ctrl + C) i seen in console that messages:
[14399:14410:0802/142733.750943:ERROR:broker_posix.cc(104)] Error sending sync broker message: Broken pipe (32)
[14399:14410:0802/142733.761023:ERROR:broker_posix.cc(104)] Error sending sync broker message: Broken pipe (32)
[14399:14409:0802/142733.761203:ERROR:broker_posix.cc(104)] Error sending sync broker message: Broken pipe (32)
[14399:14409:0802/142733.761402:ERROR:broker_posix.cc(104)] Error sending sync broker message: Broken pipe (32)
[14399:14409:0802/142733.761801:ERROR:broker_posix.cc(104)] Error sending sync broker message: Broken pipe (32)
[14399:14410:0802/142733.761896:ERROR:broker_posix.cc(104)] Error sending sync broker message: Broken pipe (32)
But if I'am using nwjs-builder-phoenix and running SDK - working correctly.
How to reproduce
Prepare
Download and extract fake data to parsing: https://github.com/trofivan/myq-jobs-archive-parser/releases/download/v0.1.0/fake-data-big.zip
git clone https://github.com/trofivan/myq-jobs-archive-parser.git
cd myq-jobs-archive-parser
npm i
Working correctly (only with nwjs-builder-phoenix SDK)
npm start
In the opened window click Select folder to parse
Select folder with fake data
Wait some time while data will have parsed.
Use filters
Close the program
Working not correctly
npm run build.dist
cd dist/myq-jobs-archive-parser-0.1.3-linux-x64/
./myq-jobs-archive-parser
Select folder to parse and waiting some time.
The program does not respond.
Close program (Ctrl + C or [x] on the window) and see console output:
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
[16012:16023:0802/145405.677499:ERROR:broker_posix.cc(104)] Error sending sync broker message: Broken pipe (32)
[16012:16023:0802/145405.678176:ERROR:broker_posix.cc(104)] Error sending sync broker message: Broken pipe (32)
[16012:16012:0802/145405.679403:ERROR:broker_posix.cc(104)] Error sending sync broker message: Broken pipe (32)
[16012:16012:0802/145405.679587:ERROR:command_buffer_proxy_impl.cc(100)] ContextResult::kFatalFailure: AllocateAndMapSharedMemory failed
killall exe - to stop the process
PS:
If download nwjs from the official website, working not correctly with SDK version also.
On Linux system program not responded when comes to the game Web Worker: https://github.com/trofivan/myq-jobs-archive-parser/blob/master/src/middlewares/fetchJobs.js
When program not responding I'm can not open Chrome dev tools and get more info.

Failure running Overtone and SuperCollider

I can't get overtone to work with supercollider server, I'm following the getting started guide at https://github.com/overtone/overtone/wiki/Getting-Started, I've got Jack audio server running through qjackctl, then I ran SuperCollider with scsynth -u 8888 which produced the following output:
Found 12 LADSPA plugins
JackDriver: client name is 'SuperCollider'
SC_AudioDriver: sample rate = 48000.000000, driver's block size = 1024
SuperCollider 3 server ready.
Zeroconf: registered service 'SuperCollider'
then in the clojure repl I connect to SC server:
(connect-external-server 8888)
then when I run (definst foo [] (saw 220))
I get the following error:
CompilerException java.util.concurrent.TimeoutException: deref! timeout
error. Dereference took longer than 5000 ms whilst blocking until the
following node has completed loading: #<synth-group[loading]: Inst foo
Container 41>, compiling:(form-init1483192646581877285.clj:131:7)
and scsynth outputs FAILURE IN SERVER /g_new Group 31 not found
also if I try (demo (sin-osc)) I get the error FAILURE IN SERVER /s_new Group 7 not found
although if I run using sclang:
s.boot;
{ SinOsc.ar(440, 0, 0.2) }.play;
it does produce a sound.
I'm running Manjaro Linux using the Linux 4.9.27 real time Manjaro kernel
and an HDA Intel PCH sound card.

Is it possible to connect to Mobile Safari remote debugger protocol using python?

I have an HTML5-based application running on iOS and I want to connect to it using the webkit remote debugger protocol 1 that is now supported in iOS 5 2.
I am trying to track down a problem where my javascript application is hard crashing the browser (SEG_FAULT). I would like to get a trace of the application as it executes so I can see what line(s) or network operations may be leading to the issue. My current idea is to write a python application that will connect to the remote debugger and keep stepping through the code and collecting information to a log file while I interact with the application.
I ran into an initial hurdle though that I can't find any examples or documentation about how to connect to the debugger and communicate or even if it is possible.
Does anyone know if this is possible and if so can you point me at some documentation and/or example code?
Based on the code from also below I created a project on github to test out some of the ideas. You can find it here: abierbaum:/python_webkit-remote_debugger
Yes, if you've got the inspector enabled in your UIWebView by following the instructions, it should be possible to connect to it from Python. I played around with it, and figured out how to send and receive commands using a Web Socket. Here's a script for Python 2.7 using websocket-client
import json
import socket
from websocket import WebSocket
ws = WebSocket()
# if ipv6
ws.io_sock = ws.sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
ws.connect("ws://localhost:9999/devtools/page/1")
counter = 0
def send(method, params):
global counter
counter += 1
# separators is important, you'll get "Message should be in JSON format." otherwise
message = json.dumps({"id": counter, "method": method, "params": params}, separators=(',', ':'))
print "> %s" % (message,)
ws.send(message)
def recv():
result = ws.recv()
print "< %s" % (result,)
send('Runtime.evaluate', {'expression': 'alert("hello from python")'})
recv()
This uses the Runtime.evaluate function to show an alert.
I tried running it against MobileSafari running in the simulator, and it worked fine. I noticed two important things:
the remote server is bound to an IPv6 port, and websocket-client didn't connect without the line to override the socket and set the family. Not sure if it would be the same running on a device or in a UIWebView.
it doesn't like spaces around the separators in the JSON.
Here's what it looks like enabling the inspector in MobileSafari using gdb and running the script:
$ ps x | grep MobileSafari
4968 ?? Z 0:00.00 (MobileSafari)
6234 ?? S 0:00.69 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk//Applications/MobileSafari.app/MobileSafari
6238 s007 R+ 0:00.00 grep MobileSafari
$ gdb
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov 3 21:59:02 UTC 2011)
...
(gdb) attach 6234
Attaching to process 6234.
Reading symbols for shared libraries . done
Reading symbols for shared libraries ........................................................................................................................................................ done
0x99798c22 in mach_msg_trap ()
(gdb) p (void *)[WebView _enableRemoteInspector]
$1 = (void *) 0x2ac93ce
(gdb) detach
Detaching from process 6234.
(gdb) quit
$ python debug.py
> {"params":{"expression":"alert(\"hello from python\")"},"id":1,"method":"Runtime.evaluate"}
< {"result":{"result":{"type":"undefined","description":"undefined"}},"id":1}

Resources