Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

HomeBrew Gen3 PCB: WiFi+BT+GPS+MUSB+Relay !

  • Please log in to reply
2100 replies to this topic

#901 tjay

tjay

    Gemini

  • *****
  • Posts: 3,343
  • Joined: 03 Feb 2007
  • Loc: just outside of Toronto

Posted 30 November 2023 - 06:37 PM

Here is a pre-release of the next HBG3 firmware, specifically aimed at people who have wired up a Stepper Motor to the HBG3 for use as a Celestron-compatible Focus Motor.  This version implements the long-awaited "Calibration" of the "Focus Motor", using the OLED display and push-button.

attachicon.gif hbg3.ino.txt

 

Definitely cool stuff Mark!

 

Just a comment, please take it for whatever you think it's worth.  Some people (particularly ones using ZWO EAFs with Hyperstars) have had issues with only 60000 (roughly) focuser steps.  I don't know if the Celestron focuser has a limit of a two byte step counter, but it might be worth allowing more steps if it can be done.


Edited by tjay, 30 November 2023 - 08:20 PM.


#902 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 30 November 2023 - 07:57 PM

No need to quote the ENTIRE message, mate!

 

Some people (particularly ones using ZWO EAFs with Hyperstars) have had issues with only 60000 (roughly) focuser steps.

The aim here is to mimic the Celestron Focus Motor, for compatibility with all of the software and apps that already know how to manage one of those.  Celestron uses 0..60000 so that's what we use.  The useful range is probably less than that -- it depends upon how many steps the Stepper motor and gearing have per revolution of the focuser.

 

The issue isn't really the 60000 steps from min to max possible, but rather the number of steps per revolution of the focuser.


Edited by mlord, 30 November 2023 - 08:04 PM.

  • tjay likes this

#903 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 01 December 2023 - 12:53 PM

Here is v8.20 v8.21 of the Arduino ESP32 source code for this project:  Attached File  hbg3.ino.v8.21.txt   264.43KB   21 downloads

  • Light up BLUE LED while calibrating a newly plugged-in Nunchuck after boot.
  • New NVRAM variable for "focus.limits"
  • New OLED interface for FOCUS status and setting of FOCUS limits.
  • Don't show GPS on OLED unless detected.
  • Fix Factory Reset function: wasn't working after v8.19.
  • v8.21: Change "Not Connected" to "No Session" on OLED status, along with other tweaks.  See: https://www.cloudyni...7#entry13103551

I was going to hold off a while longer, but then discovered the Factory Reset bug.  So here it is!

Binaries are in the usual places for Over-The-Air (OTA) Firmware Updates.

 

Cheers


Edited by mlord, 01 December 2023 - 03:06 PM.


#904 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 01 December 2023 - 01:59 PM

Something has been nagging me for a while.  The OLED often shows "Not Connected" on the top line of the status display.  This indicates that there is "no software/app connected" to the dongle.  But it gets misinterpreted as "no WiFi Connection" by at least a few people.

 

So.. a better phrase is needed instead of "Not Connected".  It must be 14-characters or less to fit onto that part of the display.  Options I have come up with thus far include these:

  • "Not In-Use."      <<<< Can be misinterpreted as referring to the version.
  • "Not Active"       <<<< Can be misinterpreted as referring to the version.
  • "No Session"    <<<< The best suggestion so far?
  • "No App Connect"
  • blank (nothing shown)

Suggestions, anyone?


Edited by mlord, 01 December 2023 - 02:11 PM.


#905 Astro Andy

Astro Andy

    Explorer 1

  • -----
  • Posts: 62
  • Joined: 10 May 2021
  • Loc: SW UK

Posted 01 December 2023 - 02:16 PM

No app link - App connected

Ño uplink - Uplink connected

App Link Off - App Link Live



#906 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 01 December 2023 - 02:44 PM

EDIT: Done all of the below now.  v8.21 firmware is released with the changes.

 

Thanks Andy.  I'm still leaning towards "No Session" there.

That same field also shows any of these (below) depending upon the connection status:

 

Not Connected     Change to No Session

Reset Pending..   When MUSB switch is changed on-the-fly.

W2 Connected      WiFi port 2000 connected  (normal app session). Change to WiFi Connected

W3 Connected      WiFi port 3000 connected  (config/debug session). Change to WiF3 Connected

BT Connected      Bluetooth connection established.

MUSB Selected     Mount-USB switch is "On", no connection yet.

USB 115200        Mount-USB connected, showing baud rate.

USB 19200         Mount-USB connected, showing baud rate.

 

Plus these extra messages for the HomeBrew All-In-One (AIO) box:

 

E2 Connected      Ethernet port 2000 connected (normal app session). Change to Eth Connected

E3 Connected      Ethernet port 3000 connected (config/debug session). Change to Eth3 Connected


Edited by mlord, 01 December 2023 - 03:14 PM.

  • Astro Andy likes this

#907 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 01 December 2023 - 03:05 PM

v8.20 has now been replaced with v8.21, incorporating the above changes.


  • Astro Andy likes this

#908 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 02 December 2023 - 03:18 PM

Version v8.22 of the Arduino ESP32 firmware for this project is now available: Attached File  hbg3.ino.v8.22.txt   265.59KB   25 downloads

  • AIO: Show Ethernet status on OLED connection status screen when WiFi is Off.
  • AIO: Fix errors with p3000_debug_ethernet.
  • AIO: Fix hangs when switching ethernet client/server modes.
  • Ensure only char* is used with SERIAL_PRINTLN(), not Strings or QStrings.
  • Implement Push-to-Reset on OLED connection status screen.

This fixes a number of bugs, mostly affecting the All-In-One (AIO) project.

One can update to this version in any of the usual ways.

 

Cheers

Mark


  • SieglindeFestkochend likes this

#909 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 02 December 2023 - 10:22 PM

I'm still leaning towards "No Session" there.

..

Not Connected     Change to No Session

Another day, fresh ideas..  smile.gif

 

I think the term we really want there is "Idle" or "HBG3 Idle" instead of "Not Connected" or "No Session".

 

And for Bluetooth, a bit more discrimination is needed.  So "BT Connected" becomes either "BT Session" (TCP Bridge app session established), or "BT Connected" when an app is actually using the connection.

 

I considered "BT Active" for the latter, but "BT Connected" is more consistent with how WiFi and other modes are reported.


Edited by mlord, 02 December 2023 - 10:33 PM.

  • mclewis1, Zoroastro and fdboucher like this

#910 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 04 December 2023 - 08:19 AM

A belated Happy first Birthday anniversary to this project!  The first PCB version of the HBG3 was built/tested on December 2, 2022, a year ago Saturday!  cool.gif

 

And two days from now, is the three year anniversary of the beginning of the original HomeBrew WiFI+BT project that eventually got us here!  flowerred.gif  It was my own COVID- lockdown keep-busy thing, but.. kinda grew.. shocked.gif

 

This community based open source HBG3 was originally intended for Bluetooth and WiFi, but quickly proved to be much more versatile than just that.  Mount-USB, Nunchuck slewing, Focus Motor, focus controller, Dew Controller, GPS, SSAA/SSAG simulator, protocol analyzer, HBG3-Relay for tricky mount/accessory situations, OLED display, standalone use, protocol bug workarounds for CPWI etc.., reversed-ALT mounting, and a half a dozen other things I cannot recall at the moment.  smile.gif

 

Thanks to everyone who pitched in and helped, or built/acquired one of their own!

No need to reply to this post; this is enough for celebration!

 

Cheers!


Edited by mlord, 04 December 2023 - 09:01 AM.

  • mclewis1, tjay, jameslew and 6 others like this

#911 Bartec

Bartec

    Explorer 1

  • -----
  • Posts: 60
  • Joined: 31 Jan 2022
  • Loc: Russia, Krasnodar

Posted 05 December 2023 - 06:59 AM

!d93d3f4ad1a987f3da0ba12570f7ddd5.jpg


  • mlord likes this

#912 Frapeno

Frapeno

    Explorer 1

  • -----
  • Posts: 54
  • Joined: 04 Oct 2017
  • Loc: Brazil

Posted 05 December 2023 - 08:13 PM

A belated Happy first Birthday anniversary to this project!  The first PCB version of the HBG3 was built/tested on December 2, 2022, a year ago Saturday!  cool.gif

 

And two days from now, is the three year anniversary of the beginning of the original HomeBrew WiFI+BT project that eventually got us here!  flowerred.gif  It was my own COVID- lockdown keep-busy thing, but.. kinda grew.. shocked.gif

 

This community based open source HBG3 was originally intended for Bluetooth and WiFi, but quickly proved to be much more versatile than just that.  Mount-USB, Nunchuck slewing, Focus Motor, focus controller, Dew Controller, GPS, SSAA/SSAG simulator, protocol analyzer, HBG3-Relay for tricky mount/accessory situations, OLED display, standalone use, protocol bug workarounds for CPWI etc.., reversed-ALT mounting, and a half a dozen other things I cannot recall at the moment.  smile.gif

 

Thanks to everyone who pitched in and helped, or built/acquired one of their own!

No need to reply to this post; this is enough for celebration!

 

Cheers!

Congratulations flowerred.gif smile.gif waytogo.gif bow.gif !!!, thanks for great project, for sure everyone here are so proud and grateful !


  • dlwmacgregor likes this

#913 fdboucher

fdboucher

    Mariner 2

  • -----
  • Posts: 245
  • Joined: 25 May 2022
  • Loc: Les Eboulements, QC

Posted 05 December 2023 - 09:05 PM

Mark: this project of yours is just great, and a fantastic contribution to amateur astronomy. 

Thank you!  flowerred.gif


  • dlwmacgregor likes this

#914 Rac19

Rac19

    Soyuz

  • *****
  • Posts: 3,982
  • Joined: 05 Aug 2016

Posted 06 December 2023 - 07:10 PM

The GPS feature to "GPS: Return date/time when valid, even if GPS fix not yet obtained" documented in post #376 is very useful but the StarSense HC still waits fir a valid location before clearing the "Waiting for GPS" message on start up. I have been able to fix this by scrolling to the relevant OLED screen and choosing to LOAD the previously saved location. This could possibly be configurable via Telnet.

 

I think that I have seen mention somewhere that this may be made automatic (perhaps after a time delay) in a future release. Is this a likely future feature?

 

This would be useful so that when waking the Evo mount from Hibernation the only button that needs to be pressed on the HC is "Enter". The more buttons that need to be pressed on the HC when waking from Hibernation the more the chance that something could go wrong.



#915 Rac19

Rac19

    Soyuz

  • *****
  • Posts: 3,982
  • Joined: 05 Aug 2016

Posted 06 December 2023 - 07:21 PM

I have the HBG3 mainly for improved GPS performance but I would also like to use it for USB connection to the mount. I can't seem to get that to work at the moment. The necessary driver has been installed and it shows up as function correctly in the Windows Device Manager (Com 6). Both CPWI and SkyTrack allow Com 6 to be selected but neither will communicate with the mount (Evo 8). CPWI says that no Celestron devices could be found on Com 6. SkyTrack says that the mount could not be initialised.

 

I had the blue switch in the MUSB position (away from the PCB) for USB connection. I have a similar problem when using Bluetooth, which strangely generates two Com ports (Com 7 and Com 8).


Edited by Rac19, 07 December 2023 - 12:11 AM.


#916 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 06 December 2023 - 09:00 PM

The GPS feature to "GPS: Return date/time when valid, even if GPS fix not yet obtained" documented in post #376 is very useful but the StarSense HC still waits fir a valid location before clearing the "Waiting for GPS" message on start up.

Yes, it waits because it doesn't have a Location to give to the HC.

 

However.  If you take it out some night, and wait for the GPS to get a Location, you can then use the push-button on the HBG3 to SAVE that Location for next time..     So, next time, after the GPS shows Date/Time, push the button once, and the next screen will ask if you want to RESTORE the saved location..  No more waiting.

 

This was all explained a couple of weeks ago, here:  https://www.cloudyni...6#entry13082808



#917 Rac19

Rac19

    Soyuz

  • *****
  • Posts: 3,982
  • Joined: 05 Aug 2016

Posted 06 December 2023 - 09:18 PM

Yes, it waits because it doesn't have a Location to give to the HC.

 

However.  If you take it out some night, and wait for the GPS to get a Location, you can then use the push-button on the HBG3 to SAVE that Location for next time..     So, next time, after the GPS shows Date/Time, push the button once, and the next screen will ask if you want to RESTORE the saved location..  No more waiting.

 

This was all explained a couple of weeks ago, here:  https://www.cloudyni...6#entry13082808

Thanks. I did do this (after exploring the options on the OLED screen) and it allowed the HC to clear the "Waiting for GPS". My suggestion was that there could perhaps be an option (configurable) for this to happen automatically after a nominal time delay.


Edited by Rac19, 06 December 2023 - 09:28 PM.


#918 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 06 December 2023 - 10:58 PM

Thanks. I did do this (after exploring the options on the OLED screen) and it allowed the HC to clear the "Waiting for GPS". My suggestion was that there could perhaps be an option (configurable) for this to happen automatically after a nominal time delay.

Sure.  Please explain how it should work, and how I should then deal with hundreds of complaints about "GPS returning wrong position" afterwards.  Thanks.


Edited by mlord, 06 December 2023 - 11:13 PM.


#919 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 06 December 2023 - 10:59 PM

I would also like to use it for USB connection to the mount. I can't seem to get that to work at the moment.

I just re-tested that here, and it's working fine for me.


Edited by mlord, 06 December 2023 - 11:14 PM.


#920 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 06 December 2023 - 11:01 PM

I have a similar problem when using Bluetooth, which strangely generates two Com ports (Com 7 and Com 7).

That's an MS-Windows thing -- the two COM ports.  You can Google it for Microsoft's explanation.

 

However, I have noticed a problem with Bluetooth -- discovery doesn't seem to always work in MS-Windows, even when it does work on my Android devices.  I'm still puzzling through whether or not that's simply another MS-Windows "issue", or if perhaps the ESP32 support code from Espressif has a bug of some sort.

 

Once MS-Windows has successfully paired up, CPWI then usually works with Bluetooth.  Sometimes an MS-Windows reboot is required first though, after which CPWI is happy.
 


Edited by mlord, 06 December 2023 - 11:03 PM.


#921 Rac19

Rac19

    Soyuz

  • *****
  • Posts: 3,982
  • Joined: 05 Aug 2016

Posted 07 December 2023 - 12:10 AM

Sure.  Please explain how it should work, and how I should then deal with hundreds of complaints about "GPS returning wrong position" afterwards.  Thanks.

That's why it should be configurable, and disabled by default. It has to be assumed that anyone who bothers to enable this feature will know what to expect. There will always be the odd user who will complain until they are reminded that they must have enabled itsmile.gif.

 

I find the current functionality useful, it just would be nice if it was (optionally) automatic. It should only be available if there is a saved location of course.

 

Just a suggestion.



#922 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 07 December 2023 - 12:50 AM

I have noticed a problem with Bluetooth -- discovery doesn't seem to always work in MS-Windows, even when it does work on my Android devices.

Seems random.  Most of the time MS-Windows 11 does find it and pairs.  Android works 100% of the time, as does my Linux box.

 

CPWI sometimes can connect, sometimes cannot.  Not an issue with the dongle though, but rather with MS-Windows.  It either never opens the Bluetooth session, or when it does it takes too long to do so and CPWI times out before it gets talking to the HBG3.

 

Nothing to be done on the HBG3 -- this one is all Microsoft (again).
 



#923 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 07 December 2023 - 12:53 AM

That's why it should be configurable, and disabled by default. It has to be assumed that anyone who bothers to enable this feature will know what to expect. There will always be the odd user who will complain until they are reminded that they must have enabled itsmile.gif.

I had the same idea when implementing the SAVE/RESTORE thing.  And my bones tell me that the dozen emails I get every week about "what is Direct Connect" or "why does my GPS not work in the basement" are an indication to me that I really do NOT want to increase my support load further with this. 

 

Cheers


Edited by mlord, 07 December 2023 - 12:53 AM.

  • nic35 likes this

#924 Rac19

Rac19

    Soyuz

  • *****
  • Posts: 3,982
  • Joined: 05 Aug 2016

Posted 07 December 2023 - 02:15 AM

I had the same idea when implementing the SAVE/RESTORE thing.  And my bones tell me that the dozen emails I get every week about "what is Direct Connect" or "why does my GPS not work in the basement" are an indication to me that I really do NOT want to increase my support load further with this. 

 

Cheers

I understand your concern. It really depends on how long it takes to get a valid position with the HBG3 GPS module. I am starting up now at dusk, and it's much too bright to read the OLED display, to Load the Saved position. The HC came with "Waiting for GPS" when I woke the mount from Hibernation. I had no choice but to wait for the GPS to get a valid location. As it happens it didn't take too long, unlike the SkySync which can take a VERY long time. If it is typically just a few minutes, that will be a vast improvement. Time will tell and worthwhile with the current functionality.



#925 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 7,918
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 07 December 2023 - 08:00 AM

Okay, that sounds to me like you are volunteering to provide end-user support for it.  Thanks!  grin.gif

 

But first, how about checking your usage scenario.  The HBG3 turns OFF the GPS once it has a fix, after 10-minutes of no accesses by anything, to keep itself from getting too warm and to save battery power at the mount.  This generally makes sense, because the only things that normally use it are the Celestron hand-controllers, which only ever access the GPS once (after it gets a full fix) during a session.

 

So if one just turns it on and walks away, coming back half an hour later, the GPS will be OFF.  If that's not the desired behaviour, then just ensure that GPS status is being shown on the OLED, which counts as "accesses by anything".  smile.gif

 

Now, something useful that could be done here, is for the HBG3 to assume that it is not being moved significantly while powered-on.  That's a reasonable assumption at this point -- very few astronomers leave their gear powered up while driving to a new location, right?  So in this scenario, the HBG3 could automatically hang onto the Location data after getting a fix, and replay it back later if asked for it (after waiting for a new Date/Time fix).

 

That's definitely a smarter thing it could do, so I'll have a look at it today.

 

Cheers


Edited by mlord, 07 December 2023 - 08:04 AM.



CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics






Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics