I had a working Wi-Fi NodeMCU compiled code with community version 2.4.2 but wanted to add the ESP32 ADC functionality per the "See the documentation" document and used p0Val = adc.read(0); but I got
"'adc' was not declared in this scope. In attempting to get it to work I upgraded from version 2.4.2 to 2.7.0(the latest) and it still is not recognized. Is there a special .h file that I need for ADC functionality?
After upgrading to 2.7.0 my NodeMCU station immediately disconnects from the client. Ran debug Wi-Fi and here is the output:
enter code here
scandone
[WIFI] scan done
[WIFI] 5 networks found
---> 0: [6][BC:64:4B:A8:90:8D] WIFI21FA52 (-66) *
1: [1][08:D5:9D:92:52:C6] MySpectrumWiFic0-2G (-88) *
2: [1][58:90:43:0D:91:9E] MySpectrumWiFi98-2G (-93) *
3: [6][02:20:00:35:D1:CF] DIRECT-iaLexmark MC2425adw-cfd1 (-58) *
4: [6][D8:A7:56:75:BE:4E] MySpectrumWiFi48-2G (-85) *
[WIFI] Connecting BSSID: BC:64:4B:A8:90:8D SSID: WIFI21FA52 Channel: 6 (-66)
scandone
state: 0 -> 2 (b0)
state: 2 -> 0 (2)
reconnect
wifi evt: 1
This continues forever and the debug doesn't tell me anything that gives me clue what's happening. Why is my original code now not working under version 2.7.0?
The connection problem > This works for STAtion: WiFi.begin("network-name", "pass-to-network");
This fails: wifiMulti Something happened between ver 2.4.2 and 2.7.0 because the code for wifiMulti is right out of readthedoc.io
The ADC problem > readthedoc.io has: val = adc.read(0)
arduino core has: val = analogRead(A0) This works: Provides the analog counts(0-1024): p0Val = analogRead(A0); Serial.printf("Analog Counts = [%04u]",p0Val);
Related
Trying to debug ESP32-S3 with PlatformIO on VSCode with macOS on M1.
Installed ftdi drivers from their website. (installed the VCP drivers, not the D3XX ones as I couldn't find a way to compile and install them).
As ESP32-S3 has an internal debugger, I just created a USB that connects D-/D+ pins to the board gpio 19 and 20 (and grd). BTW, when I connect it to the macbook, I dont see any additional port under /dev/*
Getting the following error, regardless of my platform.ini configuration.
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz
adapter speed: 5000 kHz
Info : tcl server disabled
Info : telnet server disabled
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6010, description '*', serial '*' at bus location '*'
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6014, description '*', serial '*' at bus location '*'
.pioinit:11: Error in sourced command file:
Remote connection closed
My platformio.ini:
[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
upload_port = /dev/cu.wchusbserial553C0085431
monitor_speed=115200
build_type = debug
debug_init_break = tbreak setup
;debug_tool = esp-builtin
debug_tool = esp-prog
Removed and installed the ftdi drivers.
Got a similar error when trying with ESP-IDF.
Any thoughts?
If you are connecting the USB conector directly on esp32s3 module, you should try to change the board parameter from esp32-s3-devkitc-1 to esp32s3-builtin. This way you specify that you are using the built-in debugger.
I was trying to run the showcase given by inet4.4 framework using omnet++ version 6.0.1 and was not able to run it - in showcases -> emulation -> videostreaming.
it is a case of Using Real Applications in a Simulated Network.
if there is someone who succeeded to run it in any version of inet and omnet++, I would like to ask how you did it and which versions did you use , and if
an error like the following came up how can I fix it :
<!> Error: Cannot assign parameter 'config': xml(): Parse error: Syntax error at string-content:1 -- at /home/ubuntu/Downloads/omnetpp-6.0.1/samples/inet4.4/showcases/emulation/videostreaming/omnetpp.ini:21 -- in module (inet::Ipv4NatTable) VideoStreamingShowcase.router.ipv4.natTable (id=200), during network setup
Its working for me in Omnet6 with Inet 4.3.
*.router.ipv4.natTable.config = xml("<config> \
<entry type='prerouting' \
packetDataFilter='*Ipv4Header and destAddress=~192.168.2.99' \
srcAddress='192.168.3.99' destAddress='192.168.3.20'/> \
</config>")
Replace this in your ini file and it should run fine
I would like to compile my source-code for the ESP8266 (Extensa NONOS_SDK Toolchain is already installed and working).
This is my folder structure:
I use this Makefile from an example from Espressif: https://github.com/espressif/ESP8266_NONOS_SDK/blob/master/examples/simple_pair/Makefile
and I also use this gen_misc.sh: https://github.com/espressif/ESP8266_NONOS_SDK/blob/master/examples/simple_pair/gen_misc.sh
I am running Ubuntu 18 as a Linux Subsystem for Windows 10. This is how I called gen_misc.sh from cmd:
./gen_misc.sh
gen_misc.sh version 20150511
Please follow below steps(1-5) to generate specific bin(s):
STEP 1: choose boot version(0=boot_v1.1, 1=boot_v1.2+, 2=none)
enter(0/1/2, default 2):
0
boot mode: old
STEP 2: choose bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
enter (0/1/2, default 0):
0
ignore boot
generate bin: eagle.flash.bin+eagle.irom0text.bin
STEP 3: choose spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz)
enter (0/1/2/3, default 2):
2
spi speed: 40 MHz
STEP 4: choose spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT)
enter (0/1/2/3, default 0):
2
spi mode: DIO
STEP 5: choose spi size and map
0= 512KB( 256KB+ 256KB)
2=1024KB( 512KB+ 512KB)
3=2048KB( 512KB+ 512KB)
4=4096KB( 512KB+ 512KB)
5=2048KB(1024KB+1024KB)
6=4096KB(1024KB+1024KB)
7=4096KB(2048KB+2048KB) not support ,just for compatible with nodeMCU board
8=8192KB(1024KB+1024KB)
9=16384KB(1024KB+1024KB)
enter (0/2/3/4/5/6/7/8/9, default 0):
4
spi size: 4096KB
spi ota map: 512KB + 512KB
This is what I get as output:
start...
make: Nothing to be done for 'FORCE'.
Any ideas or help what I am doing wrong are greatly appreciated.
Please don't hesitate do ask if I didn't include any information you might need to answer this question.
the solution as suggested here is to copy the folder where you are running the script to the root of the sdk folder and run the script.
I'm following this tutorial here:
https://www.hackster.io/Salmanfarisvp/googlepi-google-assistant-on-raspberry-pi-9f3677
to use Google Asistant on my Raspberry Pi 3.
I got to step 4 (using the updated SDK) but I get the following output:
INFO:root:Connecting to embeddedassistant.googleapis.com
WARNING:root:Device config not found: [Errno 2] No such file or directory: '/home/pi/.config/googlesamples-assistant/device_config.json'
INFO:root:Registering device
ERROR:root:Option --device-model-id required when registering a device instance
There are some mentions of the same error but the solution presented there doesn't work for me (I already updated the library to the latest version)
Any help would be greatly appreciated.
Thank you !
Please follow this step in the documentation to register a device model.
Then you should include the --device-model-id parameter when you run the sample.
googlesamples-assistant-pushtotalk --project-id my-dev-project --device-model-id my-model
I am trying to simulate a scenario in Veins where I want to disable the
right of way checks at the road junctions. I looked up at the Sumo wiki and
found that the bitset is 23 for the purpose. Another lookup in the
TraCIMobility.h header bundled with Veins helped me to know that this can
be done using the function commandSetSpeedMode() for a TraCIDemo11p node
which models the vehicles in the Veins demo simulation. I am trying to
build up my model using this demo bundled with Veins.
But as I am trying to do so, SUMO crashes. I am trying to initialize the
nodes in the initialize() function of TraCIDemo11p through the following
code:
void TraCIDemo11p::initialize(int stage) {
BaseWaveApplLayer::initialize(stage);
if (stage == 0) {
traci = TraCIMobilityAccess().get(getParentModule());
annotations = AnnotationManagerAccess().getIfExists();
ASSERT(annotations);
traci->commandSetSpeedMode(23); // This is the point of modification
sentMessage = false;
lastDroveAt = simTime();
findHost()->subscribe(parkingStateChangedSignal, this);
isParking = false;
sendWhileParking = par("sendWhileParking").boolValue();
}
}
I tried to set the modes with other standard values such as 0 or 31, but
every time I get SUMO crashed.
I am unable to figure out where else I should place this command. I tried
to set the mode in some other initialization stage by adding an else clause
to it but it crashes still. What's more, eve nthe the debugger on, no error
is being shown, either in the OMNeT++ window or the sumolaunchd.py output
in OMNeT++ cmd.
Please help to understand my error. Thanks.
EDIT: adding Error message info
To make things clear, I am not receiving any error message but the exit code. I searched for the code but got no help. The usual 'this app is not responding' window pops up and the sim ends, so I suspect SUMO to crash.
The OMNeT++ environment shows the following message:
Simulation terminated with exit code: -1073741819
Working directory: C:/Users/stes-2/veins-3.0/examples/Cross Roads
Command line: c:/Users/stes-2/omnetpp-4.4/bin/opp_run.exe -r 0 -n ../veins;../../src --tkenv-image-path=../../images -l ../../src/veins omnetpp.ini
Environment variables:
OMNETPP_ROOT=c:/Users/stes-2/omnetpp-4.4
PATH=;C:/Users/stes-2/veins-3.0/src;c:\Users\stes-2\omnetpp-4.4\bin;c:\Users\stes-2\omnetpp-4.4\msys\bin;c:\Users\stes-2\omnetpp-4.4\mingw\bin;c:/Users/stes-2/omnetpp-4.4/ide/jre/bin/client;c:/Users/stes-2/omnetpp-4.4/ide/jre/bin;c:/Users/stes-2/omnetpp-4.4/ide/jre/lib/i386;.;C:\Users\stes-2\omnetpp-4.4\msys\local\bin;c:\Users\stes-2\omnetpp-4.4\mingw\bin;C:\Users\stes-2\omnetpp-4.4\msys\bin;c:\Users\stes-2\omnetpp-4.4\bin;c:\ProgramData\Oracle\Java\javapath;c:\Windows\system32;c:\Windows;c:\Windows\System32\Wbem;c:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;c:\Python27;c:\Users\stes-2\sumo-0.21.0;c:\Users\stes-2\omnetpp-4.4;
OMNETPP_IMAGE_PATH=c:\Users\stes-2\omnetpp-4.4\images
Since I am running SUMO through the sumoLaunchd.py script, the error message that turns up at the MingW cmd of OMNeT++ is:
Starting SUMO (c:/Users/stes-2/sumo-0.21.0/bin/sumo-gui.exe -c cross.sumo.cfg) o
n port 64161, seed 0
Connecting to SUMO (c:/Users/stes-2/sumo-0.21.0/bin/sumo-gui.exe -c cross.sumo.c
fg) on port 64161 (try 1)
Releasing lock on port
Starting proxy mode
Done with proxy mode
Done with proxy mode, killing SUMO
SIGTERM
Done running SUMO
Cleaning up
Result: "<?xml version="1.0"?>
<status>
<exit-code>15</exit-code>
<start>1433944271</start>
<end>1433944276</end>
<status>Exited with error code 15</status>
<stdout><![CDATA[Loading configuration... done.
]]></stdout>
<stderr><![CDATA[]]></stderr>
</status>
"
Closing connection from 127.0.0.1 on port 64160
I think you are missing some lines.
You have assigned the TraCIMobility to traci, and then you don't even consider the general commandInterface and the vehicleCommandInterface
TraCIMobility* mobility = TraCIMobilityAccess().get(getParentModule());
TraCICommandInterface* traci = mobility->getCommandInterface(); /* missing command interface */
TraCICommandInterface::Vehicle* traciVehicle = mobility->getVehicleCommandInterface(); /* missing vehicle command interface */
traciVehicle->setSpeedMode(someNumber);
I even tried to compile your code but it complains that there is no method available for TraCIMobility called commandSetSpeedMode(). But that could be due to difference in Veins versions.
Multi-stage initialization
A module/variable you are trying to access might not be ready, i.e. still has not been created, by the time you are trying to use it. In that case the multi-stage initialization feature of OMNeT++ can be used.
This means a "task" may be delayed to a later stage of the initialization of the current module:
void SomeModule::initialize(int stage)
{
ApplicationBase::initialize(stage); /* ignore if causes error */
if(stage == 0)
{
/* do this */
else if (stage == 3)
{
/* do this later */
}
}