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
2162 replies to this topic

#2101 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 8,044
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 16 June 2025 - 07:56 AM

That hand-drawn diagram is useless when trying to buy a cable online -- one cannot see the twist.  Gotta go by the identical colour ordering on each end instead.


  • Romanov_AA likes this

#2102 Lardo5150

Lardo5150

    Explorer 1

  • -----
  • Posts: 84
  • Joined: 08 Sep 2024

Posted 17 June 2025 - 12:32 PM

Can I get some help with my HomeBrew and answer a question about GPS please?

I expected some instructions but it did not come with any.

I got the below, with the three ports.

 

What is what on it?  This leads into my next question, cause I dont want to hook this up wrong.

I received a note stating not to hook up the GPS incorrectly as it does not have reverse polarity protection.

FYI, I had them send me a fully built unit.

 

So my questions are:

1. Can someone identify each port for me?

2. This actually goes with #1, but which one hooks into the AUX of my CGEM II?

3. How do you setup wifi, do you just set it to direct mode, connect to it and set it up there?  I assume some interface would pop up?  

4. GPS - the note confused me about GPS.  I was under the impression that the GMEM II mount would use the built in GPS on the HomeBrew without anything being done by me, or is that not the case?  I thought I read on the site that even with the HC connected, the mount would use the GPS on the HomeBrew....I would not have to connect one of those extra ports correct?

5. The MicroUSB port I assume is used to connect directly to the PC?

6.What is the small black push botton on the side used for?

 

HBG3-Relay-1.jpg



#2103 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 8,044
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 17 June 2025 - 01:00 PM

Can I get some help with my HomeBrew and answer a question about GPS please?

This is a HomeBrew device, developed here on CloudyNights with contributions from numerous others, and which you have probably gotten someone to pre-assemble for you. But you still have to do your own reading and learning for this.  If afterwards you'd like to contribute, by perhaps writing "instructions" that you would like to see, then please do so! 

 

The pictured device is a HBG3-Relay variant.

 

This post, describing the ports, was literally from yesterday:  https://www.cloudyni.../#entry14185691

 

The single RJ12 is for the connection to an AUX port of a Celestron computerized go-to mount.  The other two are on a secondary AUX bus for other Celestron peripherals to use.  Those are the "relay ports", so called because the HBG3 firmware will act as a packet router, relaying commands/responses between the mount AUX bus and the relay BUS.

 

In between those is a micro-USB port for a "mount USB" connection (for CPWI mainly).

 

At the other end of the device is a Nunchuck port.  You can find Nunchucks on Amazon for about $10.  They are used for easy, variable-speed slewing of the mount, and also for similar control of a Celestron (or HomeBrew) Focus Motor.

 

WiFi is done exactly the same as with a Celestron branded WiFi adapter, so read up on how Celestron does WiFi.

 

Bluetooth is explained in a link from the HBG3 site, where you should visit and read stuff:  https://rtr.ca/hbg3/

 

The black push-button operates the menu system on the built-in OLED display.

The red switch is the WiFi "mode" switch, same as on a Celestron WiFi dongle.

The blue switch is for disabling WiFi/BT and instead enabling "Mount USB" mode.  The OLED display shows the current modes.

 

I don't see a GPS receiver in the photo you posted.

But if you actually do have one on your unit, then you can instruct a hand-controller to find/use it, through the hand-controller menus.  If your mount already has a built-in GPS, then the two will be in conflict.  You can avoid the conflict by plugging your hand-controller into either of the relay ports, instead of directly into the mount.  It will then see/use only the HBG3 GPS, not the mount's GPS.  CPWI is the only other thing that ever uses a mount-connected GPS, and it will see only the HBG3 GPS (if equipped).

 

I don't think the CGEM-II has a built-in GPS, in which case there will be no conflict.  One still has to tell the Celestron hand-controller to USE the GPS though.  In the Nexstar Utilities menu, or in Time/Location Source on a StarSense hand-controller.


Edited by mlord, 17 June 2025 - 01:15 PM.


#2104 Elminster

Elminster

    Explorer 1

  • -----
  • Posts: 79
  • Joined: 19 Jan 2025
  • Loc: UK

Posted 17 June 2025 - 04:11 PM

Can I get some help with my HomeBrew and answer a question about GPS please?

I expected some instructions but it did not come with any.

I got the below, with the three ports.

 

 

When I bought the kit, rather than a fully built one, the GPS was an optional extra, https://rtr.ca/hbg3/parts.html. I purchased mine, I think, from Amazon, not the one in the parts list, but very similar.

 

I am wondering if your confusion is because you thought it came with the GPS?



#2105 quigly777

quigly777

    Sputnik

  • -----
  • Posts: 48
  • Joined: 13 Sep 2017

Posted 18 June 2025 - 09:58 AM

Well, just wanted to be sure, but I have the HBG3 Relay version purchased a bit ago.  I bought mine already assembled and due to other obligations have not done much.  Being in Central Texas waiting a bit for cooler and earlier sunset.

 

I have a Celestron 6SE and is there a benefit to having the GPS module and if so, can I get it from you so I could install it, assuming not major surgery, and perhaps a length of your shrink tubing?



#2106 StarFretz

StarFretz

    Lift Off

  • -----
  • Posts: 1
  • Joined: 12 Jun 2025

Posted 18 June 2025 - 10:17 AM

Hello !

 

I have sent 2 mails in the last 3 weeks to the dedicated adress for someone to make me an offer for a HBG3 pcb and its relay pcb but still no answer frown.gif 

 

Are they short of production or maybe it's already vacation time ?

 

Thank you in advance for any hints to get those pcbs, my soldering iron is already hot !

 

Fred



#2107 Astro Andy

Astro Andy

    Explorer 1

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

Posted 18 June 2025 - 10:54 AM

....is there a benefit to having the GPS module and if so, can I get it from you so I could install it, assuming not major surgery, and perhaps a length of your shrink tubing?

If you are not moving around much you can get away with the fake GPS by adding fixed coordinates. Internet access, for accurate time that would also be scraped from the GPS module, would be advantageous.

 

It is 4 wires on the pads next to the Blue (MUSB) switch. Easier to add 4 GPIO pins in while building just in case use is desired.


Edited by Astro Andy, 18 June 2025 - 11:03 AM.


#2108 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 8,044
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 18 June 2025 - 10:59 AM

If you are not moving around much you can get away with the fake GPS by adding fixed coordinates. Internet access, for accurate time that would also be scraped from the GPS module, would be advantageous.

Yes, the FakeGPS feature is quite good, thanks to suggestions from various people here.  It does require internet for date/time, but that can be provided from a mobile phone "hot spot", with the HBG3 in what Celestron calls "Access Point" mode, aka "client mode" in real life.


  • Astro Andy and pmchan like this

#2109 quigly777

quigly777

    Sputnik

  • -----
  • Posts: 48
  • Joined: 13 Sep 2017

Posted 18 June 2025 - 11:26 AM

Thanks, I will check out the fake GPS thingy, sounds good!  



#2110 RektX

RektX

    Lift Off

  • -----
  • Posts: 2
  • Joined: 21 Feb 2025

Posted 18 June 2025 - 08:39 PM

Hello !

I have sent 2 mails in the last 3 weeks to the dedicated adress for someone to make me an offer for a HBG3 pcb and its relay pcb but still no answer frown.gif

Are they short of production or maybe it's already vacation time ?

Thank you in advance for any hints to get those pcbs, my soldering iron is already hot !

Fred


I've sent mail with no reply yet. Don't feel alone.
  • Astro Andy and StarFretz like this

#2111 Astro Andy

Astro Andy

    Explorer 1

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

Posted 19 June 2025 - 02:47 AM

I've sent mail with no reply yet. Don't feel alone.

Me too, 4 days ago. 


  • StarFretz likes this

#2112 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 8,044
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 19 June 2025 - 04:19 PM

At first glance, I don't see why there's an issue with the ESP32-S3, but clearly there is.  Need a more detailed look at it next time, because nothing really stood out as "wrong", except that things don't work.

The other two ESP32-S3 boards arrived, identical to the first one.  So I populated the pins on one, shorted the IN-OUT pad and the RGB LED pad, and flashed it with my working firmware.

 

It works. smile.gif   So at least some of the issues I saw earlier, were likely due to me probably having damaged that first board early on.  This second one is fine.  EDIT:  As is a third board now, too!

 

But.. there is a bug in either the chip, or in the system header files.  The register value for SERIAL_8N2 is defined incorrectly, which is partly why I've been having so much difficulty getting AUX communications working reliably.  After correcting that value locally here, both SERIAL_8N1 and SERIAL_8N2 are working for me.

 

The ESP32 Technical Reference manual says there are two choices for UART_STOP_BIT_NUM:  1 means 1-stop-bit, and 2 means 1.5 stop-bits.  The combined value of 3 is not defined as valid, but that's what SERIAL_8N2 was trying to use.  So I've changed it to use the value for 1.5 stop bits, per the ESP32 manual.  Oddly, the ESP32-S3 Technical Reference manual has the same two register bits, but does not define the bit meanings.  So I've gone with the original!

 

Here's a code snapshot, with very few differences between it and the mainline HBG3 code.  Mainly just the _PIN definitions have to change: Attached File  hbg3.ino.txt   356.66KB   3 downloads

 

This code is for the ESP32-S3 module, when wired up with exactly the same AUX interface circuit (74HCT125 chip etc..) as the normal HBG3 build.  I'm betting it may also work on the ESP32-C3 module, if one adjusts the pins for the AUX bus to match an available UART there.

 

ESP32-S3.jpg

 

Next up is to wire this to a populated HBG3 Purple PCB with OLED, Nunchuck, and switches etc.. and verify all of that stuff works.  I've already tested OTA Updates, though!

 

EDIT: Nunchuck works. OLED works.


Edited by mlord, 19 June 2025 - 09:31 PM.


#2113 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 8,044
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 19 June 2025 - 09:18 PM

For the ESP32-S3 module: Nunchuck works, OLED works, OTA Firmware Update works, switches work, push-button works, AUX interface works, BLUE LED works.  WiFi works in both modes.  Bluetooth BLE not implemented yet.

 

Next is to wire it up into a more convenient form for testing, and then see about Mount-USB, and figure out whether another UART can be made available for AUX-Relay functionality.  Then add a SoftwareSerial port for GPS.

 

And eventually plumb in Bluetooth BLE.  I had this working once before, on the regular ESP32, but seem to have lost the source code.  I'll have to do it again, but it was pretty easy first time around, so I expect this all to work.

 

Then count up the remaining number of available GPIO pins, and see if we're any better off than with the regular ESP32.  If so, then this ESP32-S3 version adds a lot more (PS)RAM and Flash memory to that, for future development. It would also be great if the SPI pins were available for Ethernet again, in combination with Dew Control and a Focus Motor etc..


Edited by mlord, 19 June 2025 - 09:30 PM.

  • Romanov_AA likes this

#2114 Romanov_AA

Romanov_AA

    Lift Off

  • -----
  • Posts: 11
  • Joined: 01 Jun 2025
  • Loc: Bulgaria, Varna

Posted 20 June 2025 - 03:21 AM

Cool. I'll recompile this project and try on ESP32-C3 board.


Edited by Romanov_AA, 20 June 2025 - 05:04 AM.


#2115 pmchan

pmchan

    Lift Off

  • -----
  • Posts: 5
  • Joined: 09 Jun 2025

Posted 20 June 2025 - 08:42 AM

Me too, 4 days ago.


Same here, I contacted them 12 days ago and no reply yet, I'm lucky you were there, Andy!

I'm still waiting for the Nunchuck port, then I will be able to complete my own HBG3 setup.

In the meantime, I'm prototyping and printing the focuser parts for a Celestron 127 SLT, with the lastest version you can switch from manual to motorized by simply sliding the printed knob. For when you're out of power or just want to do it the old way. You'll notice a tiny clamp on the right to fix the future HBG3 enclosure.
Wasn't able to embed the video, so here's a link.

https://pics.pmchan....70049af9388.mp4

Edited by pmchan, 20 June 2025 - 08:45 AM.

  • Astro Andy and calhaus like this

#2116 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 8,044
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 20 June 2025 - 08:49 AM

I'll be speaking with the UK lads later today and can hopefully nudge them a bit.  :)

I do know things have been rather busier of late there for them.

 

Cheers


  • StarFretz likes this

#2117 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 8,044
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 20 June 2025 - 04:42 PM

I'll be speaking with the UK lads later today and can hopefully nudge them a bit.  smile.gif

Confirmed -- P. has an inbox with all of the various emails, and is slowly working through them.  Could be a few more days yet.
 


  • Astro Andy, pmchan and StarFretz like this

#2118 Romanov_AA

Romanov_AA

    Lift Off

  • -----
  • Posts: 11
  • Joined: 01 Jun 2025
  • Loc: Bulgaria, Varna

Posted 21 June 2025 - 10:14 AM

For the ESP32-S3 module: Nunchuck works, OLED works, OTA Firmware Update works, switches work, push-button works, AUX interface works, BLUE LED works.  WiFi works in both modes.  Bluetooth BLE not implemented yet.

I tried to recompile the project file for ESP32-C3 super mini board with edited pins.

But wi-fi don't work.

Probably doing something wrong. Boot log:

ESP-ROM:esp32c3-api1-20210207
Build:Feb  7 2021
rst:0x8 (TG1WDT_SYS_RST),boot:0xd (SPI_FAST_FLASH_BOOT)
Saved PC:0x40380000
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5820,len:0x1148
load:0x403cc710,len:0xb40
load:0x403ce710,len:0x2f58
entry 0x403cc710

92f1e8e2fcc888726ff7838dad725dd94f43438d.jpeg

Attached Files



#2119 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 8,044
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 21 June 2025 - 12:27 PM

You'll need to customize the _PIN definitions before it will boot up.

Specifically, begin with these ones:

 

#define AUXBUS_RX_PIN             18    // (RX1) from AUX bus RX pin
#define AUXBUS_TX_PIN             17    // (TX1) to AUX bus TX pin
#define AUXBUS_BUSYIN_PIN         15    // from AUX bus BUSY pin
#define AUXBUS_BUSYOUT_PIN        16    // to   AUX bus BUSY pin

 

You could change those from 18,17,15,16 to 7,6,3,4 instead.

That might boot up then.



#2120 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 8,044
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 21 June 2025 - 12:29 PM

For the ESP32-S3 module: Nunchuck works, OLED works, OTA Firmware Update works, switches work, push-button works, AUX interface works, BLUE LED works.  WiFi works in both modes.  Bluetooth BLE not implemented yet.

 

Next is to wire it up into a more convenient form for testing, and then see about Mount-USB, and figure out whether another UART can be made available for AUX-Relay functionality.

Mount-USB works, and AUX-Relay also works now that I've found some appropriate pins for it.  Still need to do BLE, and also count leftover pins.

 

Cheers



#2121 Romanov_AA

Romanov_AA

    Lift Off

  • -----
  • Posts: 11
  • Joined: 01 Jun 2025
  • Loc: Bulgaria, Varna

Posted 21 June 2025 - 04:36 PM

You'll need to customize the _PIN definitions before it will boot up.

Almost a success smile.gif  The project was compiled and flashed into the ESP32-C3 board with no errors. The access point appeared and my smartphone connected to it. But there is no connection with the mount via Skyportal app yet. Need to double-check the connections and boot log. Probably the wrong uart number in settings. AUXBUS_RX_PIN 7 and AUXBUS_TX_PIN 6 are UART0 on ESP32-C3 board. Which AUXBUS UART num is used in code?


Edited by Romanov_AA, 21 June 2025 - 05:12 PM.


#2122 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 8,044
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 21 June 2025 - 05:31 PM

AUXBUS_RX_PIN 7 and AUXBUS_TX_PIN 6 are UART0 on ESP32-C3 board. Which AUXBUS UART num is used in code?

The code uses either hwserial1 or hwserial2.

 

For the -C3, try pins 0(RX), and 1(TX).

And ensure this line says hwserial1 when you build for the -C3:

    #define auxbus_uart     hwserial1

 

Cheers



#2123 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 8,044
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 22 June 2025 - 10:13 PM

ESP32-S3: Still need to do BLE, and also count leftover pins.

BLE works -- I have a working implementation, but it needs a bit of clean-up and polish now.

This now makes the ESP32-S3 module a viable/working substitute for the original ESP32.  I still need to do some pin accounting, to see what GPIO pads are still unused, but this is looking very encouraging now!

 

Cheers


  • MarkEHansen and pmchan like this

#2124 mlord

mlord

    Cosmos

  • *****
  • topic starter
  • Posts: 8,044
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 24 June 2025 - 09:49 PM

BLE works -- I have a working implementation, but it needs a bit of clean-up and polish now.

This now makes the ESP32-S3 module a viable/working substitute for the original ESP32.  I still need to do some pin accounting, to see what GPIO pads are still unused, but this is looking very encouraging now!

GPS works, and SPI-attached Ethernet works!  I would also expect SPI-attached USB-Host to work, sharing the same pins plus one extra for Slave-Select (SS).

 

I haven't yet tidied up the proof-of-concept BLE code, but SkyPortal was willing to control the scope just fine with it, so no worries there.

 

What I have done now though, is some GPIO pin accounting.  These won't be the final pin assignments, but one can see there are still seven nine unassigned pins, which could go towards dew-control PWM, and a stepper-motor for Focus, with pins left-over.  Mind you, I'm somewhat inclined to also wire up a I2C or SPI GPIO chip for the switches/LEDs, freeing up even more GPIOs.

 

// All ESP32-S3 GPIO pins:

// GPIO 00 OLED_BUTTON_PIN (JTAG/strapping)
// GPIO 01 AUXRELAY_TX_PIN (TX2)
// GPIO 02 AUXRELAY_RX_PIN (RX2)
// GPIO 03 ETHERNET_SS_PIN (JTAG/strapping)
// GPIO 04
// GPIO 05
// GPIO 06 MUSB_SELECT_PIN
// GPIO 07 WIFI_MODE_PIN
// GPIO 08 I2C SDA
// GPIO 09 I2C SCL
// GPIO 10
// GPIO 11 SPI MOSI
// GPIO 12 SPI SCK
// GPIO 13 SPI MISO
// GPIO 14
// GPIO 15 AUXBUS_BUSYIN_PIN
// GPIO 16 AUXBUS_BUSYOUT_PIN
// GPIO 17 AUXBUS_TX_PIN (TX1)
// GPIO 18 AUXBUS_RX_PIN (RX1)
// GPIO 19 USB2/OTG D-
// GPIO 20 USB2/OTG D+
// GPIO 21 AUXRELAY_BUSYIN_PIN
// GPIO 22,23,24,25 do not exist
// GPIO 26 n/a Flash,PSRAM SPICS1
// GPIO 27 n/a Flash,PSRAM SPIHD
// GPIO 28 n/a Flash,PSRAM SPIWP
// GPIO 29 n/a Flash,PSRAM SPICS0
// GPIO 30 n/a Flash,PSRAM SPICLK
// GPIO 31 n/a Flash,PSRAM SPIQ
// GPIO 32 n/a Flash,PSRAM SPID
// GPIO 33 n/a Flash,PSRAM SPIIO4
// GPIO 34 n/a Flash,PSRAM SPIIO5
// GPIO 35 Flash,PSRAM SPIIO6
// GPIO 36 Flash,PSRAM SPIIO7
// GPIO 37 Flash,PSRAM SPIDQS
// GPIO 38 GPS_RX_PIN
// GPIO 39
// GPIO 40
// GPIO 41
// GPIO 42
// GPIO 43 UART0/USB1
// GPIO 44 UART0/USB1
// GPIO 45 GPS_TX_PIN           (JTAG/strapping)
// GPIO 46 AUXRELAY_BUSYOUT_PIN (JTAG/strapping)
// GPIO 47
// GPIO 48 RGB_BUILTIN/BLUE_LED_PIN


Edited by mlord, 25 June 2025 - 09:19 AM.

  • pmchan likes this

#2125 CeeKay

CeeKay

    Viking 1

  • -----
  • Posts: 923
  • Joined: 03 Sep 2017
  • Loc: Vancouver, WA

Posted 25 June 2025 - 05:05 AM

A question - I have the HBG3 with the OLED and push button as shown on Mark's website, and I consider it the best piece of gear I've purchased since I've started back into our hobby.  I've used it non-stop with both my CGEM II and AVX mounts since I've purchased it.  

 

I use the HBG3 in WiFi with CPWI with the mounts (plugged into the AUX port - no hand controller used), but I'd like to start adding on two accessories that I've purchased in the past and rarely used - the Smart DewHeater Controller 2x and the StarSense AutoAlign.  I have the Celestron AUX Port Splitter (93919), is there a specific order that the HBG3, Dew Heater and SSAA should be plugged in to the mount for them to all be seen by CPWI and not cause any WiFi issues? Or are there other options?

 

Thanks,




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