I am setting up an ESP32 board with myFP2ESP firmware and it compiles and installs without error and also connects to the local network without issue. This was verified using ping. The windows app installed without issue as well but when pressing the Connect button on the app I get status message saying the connection failed and an error message saying "Not Connected. myFP2ESP controller not running".
Connect IP is set to same IP that was used to ping. System is Win 11. Software and firmware are latest from this site. IDE is Arduino. WiFi is set to StationMode.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Jerry
I would need to look at the log file produced by the Windows app.
First I would check that tjhe TCPIP server on the ESP32 is enabled and running
To do that sure the Management Server and TCPIP sevrber are enabled and then reprogram the controller/
Then use a web browser and connect to the management server, and admin pg 1 will tell you if the TCPIP server is running (if not start it) and what port it is using. Use that tcpip server port numberto connect using the Windows app.
Regards
Rlbert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Where would the log file be located. The desktop shortcut did not appear to be a normal windows shortcut and there was no application folder that had myfp in the name so I am at a loss as to where the log might be. The rest of the post looks reasonable but right now there is no way to tell if the Management server or the TCIP server are running. I tried web browser access and got an Error - Connection Refused message.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Jerry
As outlined in the PDF. when the Windows application runs for the first time, it presents a log file form, letting the user specify the folder where the log files are to be stored.
For Windows app version 3.0.0.0 (and previous versions) the menu option Settings Log file can be used to reset this location - see pg 192
The desktop icon for the Windows application is a MicroSoft One-Click application link. As such it invokes the application, whose location resides in multiple places depending on what version of windows you are using. In the more recent versions of Win11 the location is varied and not were it was before(for the most part).
Windows tries to keep all the info hidden from the average user and there is really no need to know where the application and it settings are locaed and managed by Windows. As log files are NOT stored there, knowing the location would not help with your issue.
In order to get the controller configured, the PDF outlines that this is done in two parts: Part 1 - Program controller with firmware, upload data sketch files (pg 91 - 100)
INITIAL SETUP OF ARDUINO IDE TO SUPPORT ESP32
CONFIGURING THE FIRMWARE
Part 2 - Use Management server to continue the configuration (pg 101)
FINAL SETUP OF THE CONTROLLER AFTER PROGRAMMING
About connecting to the Webserver, you can't do that first. It will be in a disabled state. That is the default state after programming the controller and uploading the sketch data files.
Here is why - pg 98:
By default, the following are enabled after the firmware is programmed and sketch files are uploaded (see DEFAULT SERVICES/SERVERS INCLUDED, pg 98)
Management server = enabled = port 6060 = started = running
TCPIP server = enabled = 2020 = started = running
Web server= disabled = port 80 = stopped = not running
ASCOM Alpaca server = disabled = port 4040= stopped = not running
Hopefully you see the logic about the Management Server and TCPIP Server being enabled and started by default because they are needed for part2. Web server is no use in Part2 because you cannot alter anything.
So Part 2: Final configuration - Windows application is used for some settings and management server for others.
a) Windows application (port 2020) and the TCPIP must be running. But you only change stepsize, stepmode, position, maxstep and fine tuning the motor speed
b) use a Web browser that points to the Management Server (port 6060) - if you try to connect with the browser, you know the management server would be ruinning because if it is, you will be asked for a user name and password to login
To do b) using the Management Server, see MANAGEMENT CONSOLE pg 123
The whole purpose of splitting the two parts is
- too easy to make mistakes if all the settings have to be specified in the firmware
- confusion would abound if all that was in the firmware
- files would be complex
But using a 2 part configuration method
- easier for user as it is graphical
- means you can enable a lot of things (joystick, temperature probe) on the fly whilst the controller is running - without any need to reprogram the controller and enable/disable things in the controller_config.h file. The exception is the display because the driver code for these cannot be unloaded and reloaded dynamically (IMHO)
For you, then in summary 1
Connect controller using USB cable
Go back to the latest firmware
Enable only the board information (DRVBRD) in the file controller_config.h
In defines/stationmode_defines.h edit the mySSID/mySSID_1 with your network SSID and edit
myPASSWORD/myPASSWORD_1 with your network password
save it
In the file controller_defines.h scroll down to and enable as per
save it
Open up the serial port monitor of Arduino IDE and make sure board rate is 115200
Close the serial port monitor (otherwise you cannot upload sketch files)
2
Program the controller
Upload the sketch data files
Wait 10s
Open up the serial port monitor of Arduino IDE and make sure board rate is 115200
Press the reboot button on the Controller chip
Any boot messages will appear in the Serial port window
If loging to network fails, you will see a message about that the the controller will reboot again
If login was a success, you will see xxxx STARTED messages for servers/devices.
So there should be started messages for management and tcpip servers
If loging to network fails, it is because ssid and password do not match those of your WiFi network.
If you are using DYNAMICIP (stationmode_defines.h) then you would need to kbow the address of the controller - that is shown in the serial port window after pressing the reboot button on the esp32 chip.
Let me know how far you get. If it then all works - the next thing would be go back into controller_config,h and set the following also
FIXEDSTEPMODE
STEPSPERREVOLUTION
and anything else you are using like Display, OTA etc
and then reprogram again
The order in which things are done is important,
Regards
Robert
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the detailed response. I am making progress of a sort here.
At least I can see what is happening now. We are in a continuous reboot
mode because it thinks it is failing to log onto the network even though
it responds to a ping from any computer on the network.
Network parameters are 2.4GHz, WPA2-Personal authentication, SSID=
"ZHome_2.4" and password verified at router.
Here is a copy of the Serial monitor for one reboot cycle
Hi Jerry
As outlined in the PDF. when the Windows application runs for the first
time, it presents a log file form, letting the user specify the folder
where the log files are to be stored.
For Windows app version 3.0.0.0 (and previous versions) the menu option
Settings Log file can be used to reset this location - see pg 192
The desktop icon for the Windows application is a MicroSoft One-Click
application link. As such it invokes the application, whose location
resides in multiple places depending on what version of windows you are
using. In the more recent versions of Win11 the location is varied and
not were it was before(for the most part).
Windows tries to keep all the info hidden from the average user and
there is really no need to know where the application and it settings
are locaed and managed by Windows. As log files are NOT stored there,
knowing the location would not help with your issue.
In order to get the controller configured, the PDF outlines that this
is done in two parts:
Part 1 - Program controller with firmware, upload data sketch files (pg
91 - 100)
INITIAL SETUP OF ARDUINO IDE TO SUPPORT ESP32
CONFIGURING THE FIRMWARE
Part 2 - Use Management server to continue the configuration (pg 101)
FINAL SETUP OF THE CONTROLLER AFTER PROGRAMMING
About connecting to the Webserver, you can't do that first. It will be
in a disabled state. That is the default state after programming the
controller and uploading the sketch data files.
Here is why - pg 98:
By default, the following are enabled after the firmware is programmed
and sketch files are uploaded (see DEFAULT SERVICES/SERVERS INCLUDED,
pg 98)
Management server = enabled = port 6060 = started = running
TCPIP server = enabled = 2020 = started = running
Web server= disabled = port 80 = stopped = not running
ASCOM Alpaca server = disabled = port 4040= stopped = not running
Hopefully you see the logic about the Management Server and TCPIP
Server being enabled and started by default because they are needed for
part2. Web server is no use in Part2 because you cannot alter anything.
So Part 2: Final configuration - Windows application is used for some
settings and management server for others.
a) Windows application (port 2020) and the TCPIP must be running. But
you only change stepsize, stepmode, position, maxstep and fine tuning
the motor speed
b) use a Web browser that points to the Management Server (port 6060) -
if you try to connect with the browser, you know the management server
would be ruinning because if it is, you will be asked for a user name
and password to login
To do b) using the Management Server, see MANAGEMENT CONSOLE pg 123
The whole purpose of splitting the two parts is
- too easy to make mistakes if all the settings have to be specified in
the firmware
- confusion would abound if all that was in the firmware
- files would be complex
But using a 2 part configuration method
- easier for user as it is graphical
- means you can enable a lot of things (joystick, temperature probe) on
the fly whilst the controller is running - without any need to
reprogram the controller and enable/disable things in the
controller_config.h file. The exception is the display because the
driver code for these cannot be unloaded and reloaded dynamically
(IMHO)
For you, then in summary
1
Connect controller using USB cable
Go back to the latest firmware
Enable only the board information (DRVBRD) in the file
controller_config.h
In defines/stationmode_defines.h edit the mySSID/mySSID_1 with your
network SSID and edit
myPASSWORD/myPASSWORD_1 with your network password
save it
In the file controller_defines.h scroll down to and enable as per
define BOOTPRINT 1
define DEBUGPRINT 2
define ERRORPRINT 3
save it
Open up the serial port monitor of Arduino IDE and make sure board rate
is 115200
Close the serial port monitor (otherwise you cannot upload sketch
files)
2
Program the controller
Upload the sketch data files
Wait 10s
Open up the serial port monitor of Arduino IDE and make sure board rate
is 115200
Press the reboot button on the Controller chip
Any boot messages will appear in the Serial port window
If loging to network fails, you will see a message about that the the
controller will reboot again
If login was a success, you will see xxxx STARTED messages for
servers/devices.
So there should be started messages for management and tcpip servers
If loging to network fails, it is because ssid and password do not
match those of your WiFi network.
If you are using DYNAMICIP (stationmode_defines.h) then you would need
to kbow the address of the controller - that is shown in the serial
port window after pressing the reboot button on the esp32 chip.
Let me know how far you get. If it then all works - the next thing
would be go back into controller_config,h and set the following also
FIXEDSTEPMODE
STEPSPERREVOLUTION
and anything else you are using like Display, OTA etc
and then reprogram again
So its clear that it failed to logon to the Wifi network.
Here is a copy of the Serial monitor for one reboot cycle
10:05:16.388 -> Load station mode
10:05:34.580 -> could not log on to network - rebooting
Note the 18s elapsed time.
In controller_config.h
rename
ENABLE_READWIFICONFIG
to
READWIFICONFIG
then try again
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That did the trick. Both windows program and management server are now
working. Found offending code in two places in controller_config.h.
Also found the same code in the main module as well as in
controller_defines.h. I did not change the controller_defines.h entry
although it looks like it should be changed. Thanks for all of the
help. I will let you know if I have any other issues.
So its clear that it failed to logon to the Wifi network.
Here is a copy of the Serial monitor for one reboot cycle
10:05:16.388 -> Load station mode
10:05:34.580 -> could not log on to network - rebooting
Note the 18s elapsed time.
In controller_config.h
rename
ENABLE_READWIFICONFIG
to
READWIFICONFIG
Here are the changes and locations.
In all cases ReadWifiConfig was searched for and if shown as
"Enable_ReadWifiConfig" then the "Enable_" was deleted. Locations are as
follows:
In Controller_Config.h
line133 - changed
line 184 - changed
line 185 - comment changed for consistency
In Controller_defines.h
line 70 - Not changed as it was part of Undef statement
In myfp2esp32F
ReadWifiConfig was found in the following locations but not preceded by
"Enable_" so no changes were made.
lines 86, 690, 729 - comments
lines 695, 696, 935 - statements
Compile and verify has started throwing errors. Made a couple of
changes to the display type in controller_config.h and now I am getting
errors in the tcpip_server.cpp. Reversed the changes but the error
persists.
Specific error is in line 1227 - snprintf(cd, len + 2, "%c%s%c", '$',
cdata, _EOFSTR);
Error message is as follows:
E:\JerrysDocuments\Arduino\FocusPro2\myfp2esp32-305\myfp2esp32-305\myfp2esp32F\tcpip_server.cpp:
In member function 'void TCPIP_SERVER::process_command(int)':
tcpip_server.cpp:1227:35: error: format '%s' expects argument of type
'char*', but argument 5 has type 'String' [-Werror=format=]
snprintf(cd, len + 2, "%c%s%c", '$', cdata, _EOFSTR);
^~~~~~~~
cc1plus.exe: some warnings being treated as errors
Firmware version is 305 dated 13/12/22. Downloaded from GitHub. The
code below matches what I have here except for the indent size on the
snprintf line which is one space character greater than the adjacent
lines. That should have no effect on the compilation.
Correction to previous email. Ping to correct IP fails with a
Destination Host Unreachable message. I was pinging the wrong IP before
as I have several ESP devices connected. I ran a standalone network
connection sketch however and got a successful ping result with the same
ssid and password.
sketch results from serial monitor for the network test follows:
11:08:52.724 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
11:08:52.724 -> configsip: 0, SPIWP:0xee
11:08:52.724 ->
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
11:08:52.724 -> mode:DIO, clock div:1
11:08:52.724 -> load:0x3fff0030,len:1184
11:08:52.724 -> load:0x40078000,len:13220
11:08:52.724 -> ho 0 tail 12 room 4
11:08:52.724 -> load:0x40080400,len:3028
11:08:52.724 -> entry 0x400805e4
11:08:53.132 -> Connecting to WiFi.
11:08:53.601 -> Connected to the WiFi network
11:08:53.601 -> IP address: 10.0.0.133
11:08:53.650 -> You can try to ping me
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
Serial.print("Connecting to WiFi");
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
}
Serial.println("\nConnected to the WiFi network");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
// put your main code here, to run repeatedly:
if ((WiFi.status() == WL_CONNECTED)) //Check status
{
Serial.println("You can try to ping me");
delay(5000);
}
else
{
Serial.println("Connection lost");
}
}
Hi Jerry
As outlined in the PDF. when the Windows application runs for the first
time, it presents a log file form, letting the user specify the folder
where the log files are to be stored.
For Windows app version 3.0.0.0 (and previous versions) the menu option
Settings Log file can be used to reset this location - see pg 192
The desktop icon for the Windows application is a MicroSoft One-Click
application link. As such it invokes the application, whose location
resides in multiple places depending on what version of windows you are
using. In the more recent versions of Win11 the location is varied and
not were it was before(for the most part).
Windows tries to keep all the info hidden from the average user and
there is really no need to know where the application and it settings
are locaed and managed by Windows. As log files are NOT stored there,
knowing the location would not help with your issue.
In order to get the controller configured, the PDF outlines that this
is done in two parts:
Part 1 - Program controller with firmware, upload data sketch files (pg
91 - 100)
INITIAL SETUP OF ARDUINO IDE TO SUPPORT ESP32
CONFIGURING THE FIRMWARE
Part 2 - Use Management server to continue the configuration (pg 101)
FINAL SETUP OF THE CONTROLLER AFTER PROGRAMMING
About connecting to the Webserver, you can't do that first. It will be
in a disabled state. That is the default state after programming the
controller and uploading the sketch data files.
Here is why - pg 98:
By default, the following are enabled after the firmware is programmed
and sketch files are uploaded (see DEFAULT SERVICES/SERVERS INCLUDED,
pg 98)
Management server = enabled = port 6060 = started = running
TCPIP server = enabled = 2020 = started = running
Web server= disabled = port 80 = stopped = not running
ASCOM Alpaca server = disabled = port 4040= stopped = not running
Hopefully you see the logic about the Management Server and TCPIP
Server being enabled and started by default because they are needed for
part2. Web server is no use in Part2 because you cannot alter anything.
So Part 2: Final configuration - Windows application is used for some
settings and management server for others.
a) Windows application (port 2020) and the TCPIP must be running. But
you only change stepsize, stepmode, position, maxstep and fine tuning
the motor speed
b) use a Web browser that points to the Management Server (port 6060) -
if you try to connect with the browser, you know the management server
would be ruinning because if it is, you will be asked for a user name
and password to login
To do b) using the Management Server, see MANAGEMENT CONSOLE pg 123
The whole purpose of splitting the two parts is
- too easy to make mistakes if all the settings have to be specified in
the firmware
- confusion would abound if all that was in the firmware
- files would be complex
But using a 2 part configuration method
- easier for user as it is graphical
- means you can enable a lot of things (joystick, temperature probe) on
the fly whilst the controller is running - without any need to
reprogram the controller and enable/disable things in the
controller_config.h file. The exception is the display because the
driver code for these cannot be unloaded and reloaded dynamically
(IMHO)
For you, then in summary
1
Connect controller using USB cable
Go back to the latest firmware
Enable only the board information (DRVBRD) in the file
controller_config.h
In defines/stationmode_defines.h edit the mySSID/mySSID_1 with your
network SSID and edit
myPASSWORD/myPASSWORD_1 with your network password
save it
In the file controller_defines.h scroll down to and enable as per
define BOOTPRINT 1
define DEBUGPRINT 2
define ERRORPRINT 3
save it
Open up the serial port monitor of Arduino IDE and make sure board rate
is 115200
Close the serial port monitor (otherwise you cannot upload sketch
files)
2
Program the controller
Upload the sketch data files
Wait 10s
Open up the serial port monitor of Arduino IDE and make sure board rate
is 115200
Press the reboot button on the Controller chip
Any boot messages will appear in the Serial port window
If loging to network fails, you will see a message about that the the
controller will reboot again
If login was a success, you will see xxxx STARTED messages for
servers/devices.
So there should be started messages for management and tcpip servers
If loging to network fails, it is because ssid and password do not
match those of your WiFi network.
If you are using DYNAMICIP (stationmode_defines.h) then you would need
to kbow the address of the controller - that is shown in the serial
port window after pressing the reboot button on the esp32 chip.
Let me know how far you get. If it then all works - the next thing
would be go back into controller_config,h and set the following also
FIXEDSTEPMODE
STEPSPERREVOLUTION
and anything else you are using like Display, OTA etc
and then reprogram again
<meta http-equiv="content-type" content="text/html; charset=utf-8">I think everything is working but had to suspend testing as I am currently out of town until July.
Sent from my iPhone
On Jun 12, 2023, at 9:05 PM, brownrb <brownrb@users.sourceforge.net> wrote:
Connecting to the network has once again failed. I tried to add the IR remote function and after uploading to the chip I ended up in continuous reboot mode. The serial monitor output is shown below.
:44:45.380 -> Serial started
15:44:45.380 -> ControllerData start
15:44:45.380 -> E (10) SPIFFS: mount failed, -10025
15:44:45.380 -> cd: FS start error, formatting..
15:45:06.905 -> cd: SavePersitantConfiguration() : file open for write error
15:45:06.905 -> cd: LoadBrdConfigStart() open file read error
15:45:06.905 -> cd: Could not open ntlr_var.jsn for W mode
15:45:06.951 -> Set vars and load cached vars
15:45:06.951 -> Controller mode 2
15:45:06.951 -> Load station mode
15:45:25.123 -> could not log on to network - rebooting
15:45:27.130 -> Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
15:45:27.130 ->
15:45:27.130 -> Core 1 register dump:
15:45:27.130 -> PC : 0x4017f57b PS : 0x00060d30 A0 : 0x800ea7cd A1 : 0x3ffb21e0
15:45:27.130 -> A2 : 0x00000000 A3 : 0x3ffbf888 A4 : 0x00000001 A5 : 0x3ffbdaac
15:45:27.130 -> A6 : 0x00000000 A7 : 0x00000001 A8 : 0x8008e67c A9 : 0x3ffb21c0
15:45:27.175 -> A10 : 0x00000001 A11 : 0x0000a310 A12 : 0x00009e62 A13 : 0x00060d23
15:45:27.175 -> A14 : 0x00060d20 A15 : 0x00000001 SAR : 0x00000017 EXCCAUSE: 0x0000001c
15:45:27.175 -> EXCVADDR: 0x0000000c LBEG : 0x4008a181 LEND : 0x4008a191 LCOUNT : 0xfffffff6
15:45:27.175 ->
15:45:27.175 ->
15:45:27.175 -> Backtrace: 0x4017f578:0x3ffb21e0 0x400ea7ca:0x3ffb2200 0x400eb9bf:0x3ffb2220 0x400fe93e:0x3ffb2290
15:45:27.175 ->
15:45:27.175 ->
15:45:27.175 ->
15:45:27.175 ->
15:45:27.175 -> ELF file SHA256: 28432c06e1e0d588
15:45:27.175 ->
15:45:27.364 -> Rebooting...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Jerry
Good news. The serial output is useful to see what happens at boot time.
generally reboots are caused by
1. Data sketch files not loaded
2. network issues - ssid/password - wificonfig.h enabled and no wificonfig.json file
3. invalid cntlr_config.jsn - in most cases because it is from older firmware and user updated the firmware but did not upload the new data sketch files
You can also look at the esp8266 Exception Decoder tool (for arduino 1.18.9)
After programming and upload, one opens the exception decoder and pastes the data into the top portion window, then in the bottom window you can often see the error causing the exception
I am setting up an ESP32 board with myFP2ESP firmware and it compiles and installs without error and also connects to the local network without issue. This was verified using ping. The windows app installed without issue as well but when pressing the Connect button on the app I get status message saying the connection failed and an error message saying "Not Connected. myFP2ESP controller not running".
Connect IP is set to same IP that was used to ping. System is Win 11. Software and firmware are latest from this site. IDE is Arduino. WiFi is set to StationMode.
Hi Jerry
I would need to look at the log file produced by the Windows app.
First I would check that tjhe TCPIP server on the ESP32 is enabled and running
To do that sure the Management Server and TCPIP sevrber are enabled and then reprogram the controller/
Then use a web browser and connect to the management server, and admin pg 1 will tell you if the TCPIP server is running (if not start it) and what port it is using. Use that tcpip server port numberto connect using the Windows app.
Regards
Rlbert
Where would the log file be located. The desktop shortcut did not appear to be a normal windows shortcut and there was no application folder that had myfp in the name so I am at a loss as to where the log might be. The rest of the post looks reasonable but right now there is no way to tell if the Management server or the TCIP server are running. I tried web browser access and got an Error - Connection Refused message.
Hi Jerry
As outlined in the PDF. when the Windows application runs for the first time, it presents a log file form, letting the user specify the folder where the log files are to be stored.
For Windows app version 3.0.0.0 (and previous versions) the menu option Settings Log file can be used to reset this location - see pg 192
The desktop icon for the Windows application is a MicroSoft One-Click application link. As such it invokes the application, whose location resides in multiple places depending on what version of windows you are using. In the more recent versions of Win11 the location is varied and not were it was before(for the most part).
Windows tries to keep all the info hidden from the average user and there is really no need to know where the application and it settings are locaed and managed by Windows. As log files are NOT stored there, knowing the location would not help with your issue.
In order to get the controller configured, the PDF outlines that this is done in two parts:
Part 1 - Program controller with firmware, upload data sketch files (pg 91 - 100)
INITIAL SETUP OF ARDUINO IDE TO SUPPORT ESP32
CONFIGURING THE FIRMWARE
Part 2 - Use Management server to continue the configuration (pg 101)
FINAL SETUP OF THE CONTROLLER AFTER PROGRAMMING
About connecting to the Webserver, you can't do that first. It will be in a disabled state. That is the default state after programming the controller and uploading the sketch data files.
Here is why - pg 98:
By default, the following are enabled after the firmware is programmed and sketch files are uploaded (see DEFAULT SERVICES/SERVERS INCLUDED, pg 98)
Management server = enabled = port 6060 = started = running
TCPIP server = enabled = 2020 = started = running
Web server= disabled = port 80 = stopped = not running
ASCOM Alpaca server = disabled = port 4040= stopped = not running
Hopefully you see the logic about the Management Server and TCPIP Server being enabled and started by default because they are needed for part2. Web server is no use in Part2 because you cannot alter anything.
So Part 2: Final configuration - Windows application is used for some settings and management server for others.
a) Windows application (port 2020) and the TCPIP must be running. But you only change stepsize, stepmode, position, maxstep and fine tuning the motor speed
b) use a Web browser that points to the Management Server (port 6060) - if you try to connect with the browser, you know the management server would be ruinning because if it is, you will be asked for a user name and password to login
To do b) using the Management Server, see MANAGEMENT CONSOLE pg 123
The whole purpose of splitting the two parts is
- too easy to make mistakes if all the settings have to be specified in the firmware
- confusion would abound if all that was in the firmware
- files would be complex
But using a 2 part configuration method
- easier for user as it is graphical
- means you can enable a lot of things (joystick, temperature probe) on the fly whilst the controller is running - without any need to reprogram the controller and enable/disable things in the controller_config.h file. The exception is the display because the driver code for these cannot be unloaded and reloaded dynamically (IMHO)
For you, then in summary
1
Connect controller using USB cable
Go back to the latest firmware
Enable only the board information (DRVBRD) in the file controller_config.h
In defines/stationmode_defines.h edit the mySSID/mySSID_1 with your network SSID and edit
myPASSWORD/myPASSWORD_1 with your network password
save it
In the file controller_defines.h scroll down to and enable as per
save it
Open up the serial port monitor of Arduino IDE and make sure board rate is 115200
Close the serial port monitor (otherwise you cannot upload sketch files)
2
Program the controller
Upload the sketch data files
Wait 10s
Open up the serial port monitor of Arduino IDE and make sure board rate is 115200
Press the reboot button on the Controller chip
Any boot messages will appear in the Serial port window
If loging to network fails, you will see a message about that the the controller will reboot again
If login was a success, you will see xxxx STARTED messages for servers/devices.
So there should be started messages for management and tcpip servers
If loging to network fails, it is because ssid and password do not match those of your WiFi network.
If you are using DYNAMICIP (stationmode_defines.h) then you would need to kbow the address of the controller - that is shown in the serial port window after pressing the reboot button on the esp32 chip.
Let me know how far you get. If it then all works - the next thing would be go back into controller_config,h and set the following also
FIXEDSTEPMODE
STEPSPERREVOLUTION
and anything else you are using like Display, OTA etc
and then reprogram again
The order in which things are done is important,
Regards
Robert
Thanks for the detailed response. I am making progress of a sort here.
At least I can see what is happening now. We are in a continuous reboot
mode because it thinks it is failing to log onto the network even though
it responds to a ping from any computer on the network.
Network parameters are 2.4GHz, WPA2-Personal authentication, SSID=
"ZHome_2.4" and password verified at router.
Here is a copy of the Serial monitor for one reboot cycle
10:05:15.796 -> Rebooting...
10:05:15.796 -> ets Jul 29 2019 12:21:46
10:05:15.796 ->
10:05:15.796 -> rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
10:05:15.796 -> configsip: 0, SPIWP:0xee
10:05:15.796 ->
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
10:05:15.796 -> mode:DIO, clock div:1
10:05:15.796 -> load:0x3fff0030,len:1184
10:05:15.837 -> load:0x40078000,len:13220
10:05:15.837 -> ho 0 tail 12 room 4
10:05:15.837 -> load:0x40080400,len:3028
10:05:15.837 -> entry 0x400805e4
10:05:16.201 -> Serial started
10:05:16.201 -> ControllerData start
10:05:16.388 -> Set vars and load cached vars
10:05:16.388 -> Controller mode 2
10:05:16.388 -> Load station mode
10:05:34.580 -> could not log on to network - rebooting
10:05:36.584 -> Guru Meditation Error: Core 1 panic'ed
(LoadProhibited). Exception was unhandled.
10:05:36.584 ->
10:05:36.584 -> Core 1 register dump:
10:05:36.584 -> PC : 0x4017e493 PS : 0x00060d30 A0 :
0x800ea501 A1 : 0x3ffb21e0
10:05:36.584 -> A2 : 0x00000000 A3 : 0x3ffbf888 A4 :
0x00000001 A5 : 0x3ffbc27c
10:05:36.584 -> A6 : 0x00000000 A7 : 0x00000001 A8 :
0x8008e67c A9 : 0x3ffb21c0
10:05:36.632 -> A10 : 0x00000001 A11 : 0x00004fa3 A12 :
0x00004ae9 A13 : 0x00060d23
10:05:36.632 -> A14 : 0x00060d20 A15 : 0x00000001 SAR :
0x00000017 EXCCAUSE: 0x0000001c
10:05:36.632 -> EXCVADDR: 0x0000000c LBEG : 0x4008a181 LEND :
0x4008a191 LCOUNT : 0xfffffff6
10:05:36.632 ->
10:05:36.632 ->
10:05:36.632 -> Backtrace: 0x4017e490:0x3ffb21e0 0x400ea4fe:0x3ffb2200
0x400eaa4f:0x3ffb2220 0x400fd89e:0x3ffb2290
10:05:36.632 ->
10:05:36.632 ->
10:05:36.632 ->
10:05:36.632 ->
10:05:36.632 -> ELF file SHA256: 2b8d1794047b4157
10:05:36.632 ->
10:05:36.813 -> Rebooting...
10:05:36.813 -> ets Jul 29 2019 12:21:46
Not sure where we go from here.
Regards,
Jerry Zimmer
------ Original Message ------
From "brownrb" brownrb@users.sourceforge.net
To "[myfocuserpro2-esp32:discussion]"
general@discussion.myfocuserpro2-esp32.p.re.sourceforge.net
Date 5/23/2023 4:14:24 AM
Subject [myfocuserpro2-esp32:discussion] Windows App does not Connect
don't get distracted by the Ping.
So its clear that it failed to logon to the Wifi network.
Here is a copy of the Serial monitor for one reboot cycle
10:05:16.388 -> Load station mode
10:05:34.580 -> could not log on to network - rebooting
Note the 18s elapsed time.
In controller_config.h
rename
ENABLE_READWIFICONFIG
to
READWIFICONFIG
then try again
That did the trick. Both windows program and management server are now
working. Found offending code in two places in controller_config.h.
Also found the same code in the main module as well as in
controller_defines.h. I did not change the controller_defines.h entry
although it looks like it should be changed. Thanks for all of the
help. I will let you know if I have any other issues.
Regards,
Jerry Zimmer
------ Original Message ------
From "brownrb" brownrb@users.sourceforge.net
To "[myfocuserpro2-esp32:discussion]"
general@discussion.myfocuserpro2-esp32.p.re.sourceforge.net
Date 5/23/2023 1:09:36 PM
Subject [myfocuserpro2-esp32:discussion] Re: Windows App does not
Connect
Could you please post the changes?
filename:
change
xyz
to
abc
filename:
change
xyz
to
abc
regards
Robert.
There is an update coming soon for myFP2ESP32
Updates to
Firmware
Windows Application
ASCOM Driver.
Here are the changes and locations.
In all cases ReadWifiConfig was searched for and if shown as
"Enable_ReadWifiConfig" then the "Enable_" was deleted. Locations are as
follows:
In Controller_Config.h
line133 - changed
line 184 - changed
line 185 - comment changed for consistency
In Controller_defines.h
line 70 - Not changed as it was part of Undef statement
In myfp2esp32F
ReadWifiConfig was found in the following locations but not preceded by
"Enable_" so no changes were made.
lines 86, 690, 729 - comments
lines 695, 696, 935 - statements
Regards,
Jerry Zimmer
------ Original Message ------
From "brownrb" brownrb@users.sourceforge.net
To "[myfocuserpro2-esp32:discussion]"
general@discussion.myfocuserpro2-esp32.p.re.sourceforge.net
Date 5/24/2023 6:20:06 AM
Subject [myfocuserpro2-esp32:discussion] Re: Windows App does not
Connect
Compile and verify has started throwing errors. Made a couple of
changes to the display type in controller_config.h and now I am getting
errors in the tcpip_server.cpp. Reversed the changes but the error
persists.
Specific error is in line 1227 - snprintf(cd, len + 2, "%c%s%c", '$',
cdata, _EOFSTR);
Error message is as follows:
E:\JerrysDocuments\Arduino\FocusPro2\myfp2esp32-305\myfp2esp32-305\myfp2esp32F\tcpip_server.cpp:
In member function 'void TCPIP_SERVER::process_command(int)':
tcpip_server.cpp:1227:35: error: format '%s' expects argument of type
'char*', but argument 5 has type 'String' [-Werror=format=]
snprintf(cd, len + 2, "%c%s%c", '$', cdata, _EOFSTR);
^~~~~~~~
cc1plus.exe: some warnings being treated as errors
Regards,
Jerry Zimmer
------ Original Message ------
From "brownrb" brownrb@users.sourceforge.net
To "[myfocuserpro2-esp32:discussion]"
general@discussion.myfocuserpro2-esp32.p.re.sourceforge.net
Date 5/24/2023 6:20:06 AM
Subject [myfocuserpro2-esp32:discussion] Re: Windows App does not
Connect
In the arduino ide
file-preferences-compiler warnings
set to Default
What version of the firmware are you using and where did you download it from?
in
tcpip_server.cpp
case 118 which you mention looks like
Firmware version is 305 dated 13/12/22. Downloaded from GitHub. The
code below matches what I have here except for the indent size on the
snprintf line which is one space character greater than the adjacent
lines. That should have no effect on the compilation.
Regards,
Jerry Zimmer
------ Original Message ------
From "brownrb" brownrb@users.sourceforge.net
To "[myfocuserpro2-esp32:discussion]"
general@discussion.myfocuserpro2-esp32.p.re.sourceforge.net
Date 5/25/2023 8:07:40 AM
Subject [myfocuserpro2-esp32:discussion] Re: Windows App does not
Connect
Switching to Default fixed the problem. Probably too much button
pushing on my part.
Regards,
Jerry Zimmer
------ Original Message ------
From "brownrb" brownrb@users.sourceforge.net
To "[myfocuserpro2-esp32:discussion]"
general@discussion.myfocuserpro2-esp32.p.re.sourceforge.net
Date 5/25/2023 7:59:39 AM
Subject [myfocuserpro2-esp32:discussion] Re: Windows App does not
Connect
Correction to previous email. Ping to correct IP fails with a
Destination Host Unreachable message. I was pinging the wrong IP before
as I have several ESP devices connected. I ran a standalone network
connection sketch however and got a successful ping result with the same
ssid and password.
sketch results from serial monitor for the network test follows:
11:08:52.724 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
11:08:52.724 -> configsip: 0, SPIWP:0xee
11:08:52.724 ->
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
11:08:52.724 -> mode:DIO, clock div:1
11:08:52.724 -> load:0x3fff0030,len:1184
11:08:52.724 -> load:0x40078000,len:13220
11:08:52.724 -> ho 0 tail 12 room 4
11:08:52.724 -> load:0x40080400,len:3028
11:08:52.724 -> entry 0x400805e4
11:08:53.132 -> Connecting to WiFi.
11:08:53.601 -> Connected to the WiFi network
11:08:53.601 -> IP address: 10.0.0.133
11:08:53.650 -> You can try to ping me
code for network connection test follows:
// put your setup code here, to run once:
include <wifi.h>;</wifi.h>
const char ssid = "ZHome_2.4";
const char password = "xxxxxxxxxxxxxxxxxx";
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
Serial.print("Connecting to WiFi");
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
}
Serial.println("\nConnected to the WiFi network");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
// put your main code here, to run repeatedly:
if ((WiFi.status() == WL_CONNECTED)) //Check status
{
Serial.println("You can try to ping me");
delay(5000);
}
else
{
Serial.println("Connection lost");
}
}
Regards,
Jerry Zimmer
------ Original Message ------
From "brownrb" brownrb@users.sourceforge.net
To "[myfocuserpro2-esp32:discussion]"
general@discussion.myfocuserpro2-esp32.p.re.sourceforge.net
Date 5/23/2023 4:14:24 AM
Subject [myfocuserpro2-esp32:discussion] Windows App does not Connect
sorry I cannot comment on other programs you might try
Is everything sorted or still having issues?
Connecting to the network has once again failed. I tried to add the IR remote function and after uploading to the chip I ended up in continuous reboot mode. The serial monitor output is shown below.
:44:45.380 -> Serial started
15:44:45.380 -> ControllerData start
15:44:45.380 -> E (10) SPIFFS: mount failed, -10025
15:44:45.380 -> cd: FS start error, formatting..
15:45:06.905 -> cd: SavePersitantConfiguration() : file open for write error
15:45:06.905 -> cd: LoadBrdConfigStart() open file read error
15:45:06.905 -> cd: Could not open ntlr_var.jsn for W mode
15:45:06.951 -> Set vars and load cached vars
15:45:06.951 -> Controller mode 2
15:45:06.951 -> Load station mode
15:45:25.123 -> could not log on to network - rebooting
15:45:27.130 -> Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
15:45:27.130 ->
15:45:27.130 -> Core 1 register dump:
15:45:27.130 -> PC : 0x4017f57b PS : 0x00060d30 A0 : 0x800ea7cd A1 : 0x3ffb21e0
15:45:27.130 -> A2 : 0x00000000 A3 : 0x3ffbf888 A4 : 0x00000001 A5 : 0x3ffbdaac
15:45:27.130 -> A6 : 0x00000000 A7 : 0x00000001 A8 : 0x8008e67c A9 : 0x3ffb21c0
15:45:27.175 -> A10 : 0x00000001 A11 : 0x0000a310 A12 : 0x00009e62 A13 : 0x00060d23
15:45:27.175 -> A14 : 0x00060d20 A15 : 0x00000001 SAR : 0x00000017 EXCCAUSE: 0x0000001c
15:45:27.175 -> EXCVADDR: 0x0000000c LBEG : 0x4008a181 LEND : 0x4008a191 LCOUNT : 0xfffffff6
15:45:27.175 ->
15:45:27.175 ->
15:45:27.175 -> Backtrace: 0x4017f578:0x3ffb21e0 0x400ea7ca:0x3ffb2200 0x400eb9bf:0x3ffb2220 0x400fe93e:0x3ffb2290
15:45:27.175 ->
15:45:27.175 ->
15:45:27.175 ->
15:45:27.175 ->
15:45:27.175 -> ELF file SHA256: 28432c06e1e0d588
15:45:27.175 ->
15:45:27.364 -> Rebooting...
Ignore my last post. Found my error. Was not uploading data files after uploading program.
Hi Jerry
Good news. The serial output is useful to see what happens at boot time.
generally reboots are caused by
1. Data sketch files not loaded
2. network issues - ssid/password - wificonfig.h enabled and no wificonfig.json file
3. invalid cntlr_config.jsn - in most cases because it is from older firmware and user updated the firmware but did not upload the new data sketch files
You can also look at the esp8266 Exception Decoder tool (for arduino 1.18.9)
After programming and upload, one opens the exception decoder and pastes the data into the top portion window, then in the bottom window you can often see the error causing the exception
So yo uwould copy this block
15:45:27.130 -> Core 1 register dump:
15:45:27.130 -> PC : 0x4017f57b PS : 0x00060d30 A0 : 0x800ea7cd A1 : 0x3ffb21e0
15:45:27.130 -> A2 : 0x00000000 A3 : 0x3ffbf888 A4 : 0x00000001 A5 : 0x3ffbdaac
15:45:27.130 -> A6 : 0x00000000 A7 : 0x00000001 A8 : 0x8008e67c A9 : 0x3ffb21c0
15:45:27.175 -> A10 : 0x00000001 A11 : 0x0000a310 A12 : 0x00009e62 A13 : 0x00060d23
15:45:27.175 -> A14 : 0x00060d20 A15 : 0x00000001 SAR : 0x00000017 EXCCAUSE: 0x0000001c
15:45:27.175 -> EXCVADDR: 0x0000000c LBEG : 0x4008a181 LEND : 0x4008a191 LCOUNT : 0xfffffff6
15:45:27.175 ->
15:45:27.175 ->
15:45:27.175 -> Backtrace: 0x4017f578:0x3ffb21e0 0x400ea7ca:0x3ffb2200 0x400eb9bf:0x3ffb2220 0x400fe93e:0x3ffb2290
15:45:27.175 ->
15:45:27.175 ->
15:45:27.175 ->
15:45:27.175 ->
15:45:27.175 -> ELF file SHA256: 28432c06e1e0d588
into the exception decoder. If you do other projects with esp32 this might come in handly..
Regards
Robert