Mark - it looks like the project website changed along with the process to update the firmware file to update to the latest version. I no longer see a link to the page that provided the instructions for updating the firmware and the link for the latest file. Do we now need to download the entire zip file HBG3_Arduino zip file to update the firmware? Thanks.
HomeBrew Gen3 PCB: WiFi+BT+GPS+MUSB+Relay !
#676
Posted 06 September 2023 - 07:49 AM
#677
Posted 06 September 2023 - 08:05 AM
Get the IDE .ZIP file, linked from this thread and from the hbg3 site. It has everything needed already installed and configured. http://feral.rtr.ca/HBG3_Arduino.zip
You will first have to ensure the machine has the SiLabs USB-Serial driver installed:
MS-Windows users will need to install the Universal CP210x Serial Port drivers (either from https://www.silabs.c...s?tab=downloads, or using the copy included in the provided Arduino .ZIP archive above). Extract the driver ZIP contents, then right-click on the extracted silabser.inf file, and click INSTALL. You should now be able to connect the HomeBrew USB to the PC and see it be assigned a COM port. Linux users (of course!) will already have the driver (built into the kernel).
After that, things are pretty simple.
You just run the Arduino executable, select File->Sketchbook->hbg3_v7.15/ and then select the appropriate COM port from the Tools menu. Click "upload", and sit back and watch the show.
If one already has installed the .ZIP previously, then just grab only the new source code file from the v7.15 announcement earlier, rename it to remove the .txt suffix, and then open that from the File menu in the Arduino IDE.
Die hard Luddites can still use the binary flash method if they really want to (message me), but beware that it wipes all settings from the HBG3 each time it is used. I figure that will cause more problems going forward, so best to just install the Arduino package instead -- the Arduino Serial Monitor then also becomes available for changing settings and debugging things if necessary.
Edited by mlord, 06 September 2023 - 04:16 PM.
- Frisk likes this
#678
Posted 06 September 2023 - 09:14 AM
Updated now. I just wanted to be sure that was the new process. As always, I greatly appreciate your help. Cheers!
- mlord likes this
#679
Posted 06 September 2023 - 10:59 AM
When I set "EMULATE_DEW" to false, I get and error in "oled_loop", "if (dew_detected && dew_automode[0].. "
dew_detected is not defined. It only works when EMULATE_DEW is true.
#680
Posted 06 September 2023 - 11:40 AM
When I set "EMULATE_DEW" to false, I get and error in "oled_loop", "if (dew_detected && dew_automode[0].. "
dew_detected is not defined. It only works when EMULATE_DEW is true.
I'll fix that later, but in the meanwhile just leave EMULATE_DEW (and everything else) as true.
It doesn't affect anything unless you wire up the Dew Control hardware.
Edited by mlord, 06 September 2023 - 03:06 PM.
#681
Posted 06 September 2023 - 03:19 PM
I'll fix that later, but in the meanwhile just leave EMULATE_DEW (and everything else) as true.
It doesn't affect anything unless you wire up the Dew Control hardware.
I fixed the code by adding #if EMULATE_DEW where needed.
All work fine.
#682
Posted 07 September 2023 - 12:32 PM
Here is v7.16 of the Arduino ESP32 source code for this project: hbg3.ino.v7.16.txt 225.07KB 28 downloads
- GPS: Improve/speed-up autobaud code.
- DEW: Fix build for EMULATE_DEW=false
I like and prefer the auto-baud code in this version over that from v7.15 earlier.
It now detects the GPS almost instantly, leaving a larger time window before the StarSense HC checks for GPS on start-up.
As usual, the full Arduino .ZIP/.TGZ files have also been updated to include this version.
Cheers
Mark
Edited by mlord, 07 September 2023 - 03:07 PM.
- Frisk likes this
#683
Posted 09 September 2023 - 12:19 PM
Here is v7.18 of the Arduino ESP32 source code for this project: hbg3.ino.v7.18.txt 226.22KB 25 downloads
This replaces the earlier v7.17, adding one extra fix to reduce unnecessary bus relay traffic.
This release is of interest to anyone with a HBG3-Relay device -- those should now get updated to this version.
- v7.17: RELAY: Don't forward emulated-dev requests to auxrelay: fixes emulated-dev double response bug.
- v7.17: RELAY: Auto-detect and dynamically manage the need for auxrelay_ssforward instead of a manual NVRAM setting.
- v7.18: RELAY: Don't do auxrelay_ssforward when controlled from CPWI/SkyPortal/SkySafari.
The first item is a bug fix: I noticed that the GPS on my HBG3-Relay was replying TWICE to every request. And not just the GPS: any internal "emulated" device had the same problem on the HBG3-Relay. So, fixed!
The other changes make use of the HBG3-Relay simpler. One can now plug the StarSense AutoAlign (SSAA) camera into either the mount or the relay, and the StarSense Hand-Controller (SSHC) will find it regardless of where it is plugged in. The same now also goes for CPWI, SkySafari, and SkyPortal when using the SSAA.
Previously, it was required that the SSHC and SSAA camera always be plugged together into the Relay side, unless one changed a special NVRAM setting on the HBG3. No more. It is now automatic. Note that on the Nexstar-GPS mount, the SSAA should always be used only on the Relay side -- this is a limitation of the mount itself, not the HBG3.
All HBG3-Relay devices should get updated to this version now. Others can pass on it.
Cheers
Mark
Edited by mlord, 09 September 2023 - 12:22 PM.
#684
Posted 11 September 2023 - 02:09 PM
Here is v7.19 of the Arduino ESP32 source code for this project: hbg3.ino.v7.19.txt 225.45KB 27 downloads
Anyone using Mount-USB (MUSB) should update to this version.
- MUSB: Fix it -- wasn't always working with latest CPWI.
- MUSB: Permit MUSB even when RELAY mode is also active.
- MUSB: Get rid of "RF-Kill" mode: Wireless always stays off when MUSB switch is active at power-on/reset.
- MUSB: Get rid of MUSB_ENABLED flag: always enabled in the code now.
- MUSB: Get rid of FALLBACK serial logic: no SerialDebug if MUSB is "on" and either EMULATE_GPS=true or auxrelay_detected=true
This version fixes Mount-USB so that it works again with latest CPWI.
But it also now makes it possible to use Mount-USB on the HBG3-Relay device, with some careful jiggery of UART assignments. When possible, MUSB will use hwserial1, but when auxrelay is detected it gets pushed onto to hwserial0 instead.
This gets rid of one of the very few remaining "special cases" from the code. We now have a single source code and binary, that works on every HBG3 ever built, without need for weird configuration options, or missing functionality on the Relay variants. All of which makes it easier to test, to update, and for people to use! Happy.
Cheers
Edited by mlord, 12 September 2023 - 10:55 AM.
#685
Posted 12 September 2023 - 11:10 AM
And.. here is v8.0 of the Arduino ESP32 source code for this project: hbg3.ino.v8.0.txt 227.64KB 29 downloads
- P3000: Toggle serial-debug redirection onto WiFi port 3000 with "debug" command there.
- MUSB: Make changing the MUSB switch position trigger a reset of the HBG3 after a short delay.
No compelling reason here for anyone to run and update, other than to help us all by broadening the test base.
The P3000 thing means that one can now get all of the functionality of the "serial monitor" interface over a TCP/IP connection. Just telnet to the HBG3's IP address on port 3000, and issue the new "debug" command to toggle it on/off. This enables all of the usual serial port commands, including the bus-tracing and protocol analyzer stuff, all piped through that TCP/IP connection without need of a USB cable. Linux and MacOS have telnet built-in. MS-Windows users can use the PuTTY program. https://putty.org/
The practical side of which, is that it makes debugging the Mount-USB (MUSB) feature much easier for me! Because when MUSB is active, the USB/serial connection is unavailable for use as a debug/monitor port. So one can instead now just telnet to port 3000 for the same functionality. So exciting!
And speaking of MUSB, the other change in this release is that the MUSB selection switch (the blue one) can now be toggled on-the-fly, with the new switch position taking effect 1.5 seconds after toggling it. Why the delay? It allows testing the switch without actually changing modes, if toggled up and then down again before the 1.5 second timer expires. It's the little things..
This change also means there's now a way to reset the HBG3 without having to power it off/on again.
Cheers
#686
Posted 12 September 2023 - 05:00 PM
Just an observation. I have loaded v7.19 and v8.0 ino today and did some testing. On v7.19 and v8.0 I get no GPS lock after powerup. I wait for 30 minutes and the LED screen keeps showing 00/21 all the way to 00/26, but never gets a lock. If I revert back to v7.18 I get a GPS lock within 15 seconds of powerup. Typical lock when using v7.18 is 06/21. Not sure if anyone else is seeing this. I have run about 10 tests first loading v7.19, no lock. Then v8.0 came out and I tried it, no lock. Everytime I go back to V7.18, I get an immediate lock within 30 seconds.
Gen3d, Blue switch down, Red switch down. Been running fine since my initial load of v7.7
#687
Posted 12 September 2023 - 07:17 PM
On v7.19 and v8.0 I get no GPS lock after powerup. I wait for 30 minutes and the LED screen keeps showing 00/21 all the way to 00/26, but never gets a lock. If I revert back to v7.18 I get a GPS lock within 15 seconds of powerup.
There were ZERO GPS code changes between v7.18 and v7.19 -- I just compared the source files again to make sure. So no GPS changes whatsoever there. And my HBG3 here with the BE-180 and v8.0 on it is showing GPS coordinates on the OLED.
So.. what model GPS is on your HBG3? There are a few versions commonly used, and I don't always retest with them all, so I could be missing seeing the problem. EDIT: I have now re-tested using the three most common GPS receivers: BE-180, BN-180, and BE-122. All are working just fine, indoors with an overcast sky.
The Arduino Serial Monitor can help you here. Fire it up and issue the 'G' command, and see what the output there is showing by the time you would have expected a satellite fix.
Cheers
Edited by mlord, 12 September 2023 - 09:35 PM.
#688
Posted 13 September 2023 - 06:29 AM
Here is v8.2 of the Arduino ESP32 source code for this project: hbg3.ino.v8.2.txt 235.25KB 59 downloads [UPDATED]
- v8.1: Implemented Over-The-Air (OTA) Firmware Updates.
- v8.2:
- OTA: Fix bug when scanning for Content-Length header line.
- OTA: Compare file timestamp against saved (nvram) timestamp to decide if already up-to-date or not.
- NVRAM: New NVRAM setting for suppress.lowbattery: Use '1' to block Evolution Low-Battery warnings.
- NVRAM: New NVRAM settings for OTA update server and path.
- NVRAM: Change mount.reversed.alt to a simple 0/1 setting instead of "Yes".
This version includes the new Over-The-Air (OTA) Firmware Update mechanism. To use it, the HBG3 has to be running v8.1 or higher, so one will still have to update to v8.1/v8.2 the old way before being able to use the new mechanism.
Actually, it's an "over the internet" update scheme. Once running v8.1 or newer, the HBG3 must then be connected to the internet via a local WiFi access point. So use the serial/debug monitor, or SkyPortal/SkySafari, to first configure "Access Point" mode, which means setting the SSID/passkey for your home internet into it. Eg.
set wlan.ssid MyHomeSSID
set wlan.passkey MyWiFiPasskey
save
And flip the (red) switch to the up position for Access Point mode.
With that out of the way, one then just issues the new "ota_update" command from the serial/debug monitor. Or, if equipped with OLED and button, press the button a few times until the new OTA Firmware Update screen appears, and then follow the directions given there. It will pull down whatever the latest firmware version is, and install it. Should Something Bad happen in the process, the HBG3 will continue to run with whatever firmware it had from before the update attempt.
This release REQUIRES a settings change in the Arduino IDE:
Tools --> Partition Scheme: "Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)"
So.. a bit of a nuisance getting v8.1/v8.2 installed perhaps, but going forward things should be much, much simpler.
The full .ZIP and .TGZ Arduino packages are here: https://feral.rtr.ca/
and the binary flasher for MS-Windows is here: https://rtr.ca/hbg3/flashing
Please update now!
EDIT: Once one has firmware version v8.1/v8.2 (or newer) installed, there will be no need to ever again download the source and build/upload with the Arduino IDE. Finally, a simple way to distribute firmware binaries with no installer software needed!
Edited by mlord, 14 September 2023 - 05:38 AM.
- Chote, tjay, BarryBrown and 1 other like this
#689
Posted 14 September 2023 - 01:57 PM
How do I find the IP of the HBG3 when if I am only using wifi?
Or do I need to initially use a cabled connection to set the ip?
#690
Posted 14 September 2023 - 02:00 PM
How do I find the IP of the HBG3 when if I am only using wifi?
Or do I need to initially use a cabled connection to set the ip?
You don't need to find it.
The SkyPortal/SkySafari and/or CPWI all know how to find it automatically, so long as they're all on the same WiFi network.
Otherwise, it is shown on the OLED display, and also gets output on the serial/debug monitor when it first connects in "Access Point" mode.
In "Direct Connect" mode, the IP is always 1.2.3.4
Edited by mlord, 14 September 2023 - 02:01 PM.
#691
Posted 14 September 2023 - 02:26 PM
Ok. I might have done something stupid then. I thought I had to get it connected to my home wifi. I telneted to port 3000 and configured ssid and passkey.
now I am not able to reach it any more
#692
Posted 14 September 2023 - 03:31 PM
I thought I had to get it connected to my home wifi. I telneted to port 3000 and configured ssid and passkey.
now I am not able to reach it any more
If the red switch is up (away from the PCB), then it will be in "Access Point" mode now, with a different IP address.
f you want to find out what that is, for whatever reason, then plug in the USB cable, and connect to it with PuTTY over the COM port (requires SiLabs USB-Serial driver).
Once connected, enter this command: reset
and when it reboots, it will show the new IP address if/when it manages to connect to your home WiFi. All of the port 3000 commands are also available this way.
Or.. you could check with your router, and perhaps it will tell you what IP address is assigned to the HBG3 on the home wifi. You can then telnet to port 3000 on that IP address.
Worst come to worst, you can flip the red switch back down, and the HBG3 will again be in "Direct Connect" mode, and you can re-connect to its SSID and then telnet again to port 3000 to check the wifi settings ("get all").
Cheers
Edited by mlord, 14 September 2023 - 03:33 PM.
#693
Posted 14 September 2023 - 04:20 PM
If the red switch is up (away from the PCB), then it will be in "Access Point" mode now, with a different IP address.
f you want to find out what that is, for whatever reason, then plug in the USB cable, and connect to it with PuTTY over the COM port (requires SiLabs USB-Serial driver).
Once connected, enter this command: reset
and when it reboots, it will show the new IP address if/when it manages to connect to your home WiFi. All of the port 3000 commands are also available this way.
Or.. you could check with your router, and perhaps it will tell you what IP address is assigned to the HBG3 on the home wifi. You can then telnet to port 3000 on that IP address.
Worst come to worst, you can flip the red switch back down, and the HBG3 will again be in "Direct Connect" mode, and you can re-connect to its SSID and then telnet again to port 3000 to check the wifi settings ("get all").
Cheers
Thank you. All good now.
- mlord likes this
#694
Posted 15 September 2023 - 04:22 AM
Does the 8.x work on the older All-in-One or WiFi/BT/UGPS boards?
Edited by Zoroastro, 15 September 2023 - 05:09 AM.
#695
Posted 15 September 2023 - 08:06 AM
It does not work on the All-in-One, but can work on any of the earlier WiFi+BT(+GPS) versions from the very beginning three years ago -- have to change the "#define ... PIN" lines in hbg3.ino to match those from the old programming though. Easy enough.
It even works on versions that had only a single "BUSY" pin at the ESP32 -- just define BUSYIN and BUSYOUT to be that same pin number.
Because of the pin changes, using OTA updates afterwards would not be a great thing to do though!
EDIT: if you have a particular hardware version in mind, post the PIN definitions here, and I'll show how they need to be changed to work with hbg3.ino.
Cheers
Edited by mlord, 15 September 2023 - 08:09 AM.
#696
Posted 15 September 2023 - 11:27 AM
Thanks, but I have accidentally flashed my BT/WiFi/GPS with a non-working sketch, 5.14. Maybe I can find an old sketch, I guess 4.x.
#697
Posted 16 September 2023 - 05:43 AM
Thanks for the binary. All ready for the first OTA update!
#698
Posted 16 September 2023 - 07:19 AM
Big Star Party here last night with decent sky and perhaps 500 people milling about.
So I got to test out a lot of the recent changes and improvements etc.
A few takeaways from my own gear:
- The HBG3 was rock solid. My bluetooth connection didn't waver from when I powered on and connected at 7:15pm, to when I shut down and packed up at midnight.
- StarSense AutoAlign did its magic yet again, easily finding hundreds of stars when only a dozen or so were human-visible. The centre calibration was off this time though, but later in the night I centred Vega and ran the Calibration and Alignment cycles again. After that, GOTOs were dead centre again, making finding faint DSOs a lot easier!
- It cooled down and dew became a problem. I plugged in the HBG3 dew controls, and they worked but not well enough. The Analog-to-digital conversion circuit inside the ESP32 lacks accuracy, and was off by a couple of degrees on the high side, making the Dew Controller think the corrector lens was warmer than it actually was, defeating the smart Dew Control. I will be making code adjustments for that today.
- My 5Ah DeWalt battery was still showing 2/3 bars of power at the end of the night.
- Lots of people wondered where to buy the large accessory tray that was on my Evo. https://www.cloudyni...5#entry11000084
There was a chap beside me with mostly new gear, somewhat overwhelming his 8SE mount with StarSense AutoAlign, a Celestron Focus Motor (??), large dew shield, fancy RACI finder, and a HomeBrew All-In-One (AIO) from jdlucas. Prior to using it, I did update his AIO to the latest hardware spec (74HCT125 chip) and installed the new AIO3 firmware that is now based on the HBG3.
But his set-up was cursed last night, with intermittent power issues, AUX bus issues, an inability to focus the optical tube (never saw a single star or point source of light), and the RACI finder was falling apart -- threaded portions had come loose. I helped as best I could, but those were problems that needed solving in daylight. So we may get together again.
Another new astronomer further down the line had a new-to-him 6SE, with a new SVBONY star diagonal that was flopping around. A short bit of examination there revealed a cross-threaded visual back, and loose threads on the diagonal itself. So we unscrewed the back, carefully got it to engage the threads, and put it back on nice and tight. And I cranked the "nose-piece" (forgot the term) of the diagonal firmly back into its threading, and things improved there. He had a Celestron WiFi adapter, and figured out on his own how to align the mount with SkyPortal and was viewing objects in no time. Kudos there, for sure!
So.. expect an HBG3 firmware OTA binary here later today!
Cheers
Edited by mlord, 16 September 2023 - 07:10 PM.
- Frisk likes this
#699
Posted 16 September 2023 - 03:23 PM
Here is v8.4 of the Arduino ESP32 source code for this project: hbg3.ino.v8.4.txt 241.21KB 34 downloads
Binaries are also now available for the in-device Over-The-Air (OTA) Firmware Updater on both the HBG3 and the AIO. There's also still a version for the clunky MS-Windows binary flasher.
The .ZIP and .TGZ development archives have NOT been updated yet with this release. I may not update them for a while now, since the OTA mechanism is available and works very well.
- v8.4: OLED: Fix formatting on connection status screen.
- v8.3:
- DEW: Retain "aggression" values using NVRAM.
- DEW: Be much more assertive with PWM percentages.
- DEW: Use degrees rather than half-degrees for "aggression" values (making it twice as aggressive as before).
- "get all" now shows variables sorted in order by name.
- New option to support hardware from the original WIFI+BT+GPS project.
- Support building for All-In-One hardware with HBG3 mainline code: everything working except USB-Host and Ethernet.
- Add NVRAM setting "musb.rfenable": set to 1 to leave WiFi+BT on when musb_selected: needed for port 3000 "debug".
- Add "status" command to show similar information to what OLED shows.
- Experiment with 8N1 instead of 8N2 for auxbus, with new NVRAM setting "auxbus.stopbits".
The big news with this release is that the code has been modified so it can now be built for running on the older HomeBrew Gen1 hardware, as well as (with extra files) on the HomeBrew All-In-One (AIO) project.
Go forth and update!
Edited by mlord, 16 September 2023 - 03:52 PM.
- BarryBrown likes this
#700
Posted 16 September 2023 - 07:11 PM
Updated above post with v8.4, replacing the short-lived v8.3.