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

#101 Bartec

Bartec

    Explorer 1

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

Posted 04 January 2023 - 12:13 PM

Mmm.. could do that.  But the recommended BN-180 GPS module already has an LED for that purpose.  It blinks RED once a GPS fix is established.  And a few minutes later, it is put into a low-power state, turning off both of its LEDs, another way to know a fix was achieved.

Please. I use closed cases and various GPS modules.

Attached Thumbnails

  • 20221225_135402.jpg


#102 mlord

mlord

    Cosmos

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

Posted 04 January 2023 - 12:48 PM

Looks like you already have it working.



#103 Bartec

Bartec

    Explorer 1

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

Posted 05 January 2023 - 06:32 AM

Looks like you already have it working.

This is the arduino pro mini version.



#104 thintz

thintz

    Lift Off

  • -----
  • Posts: 20
  • Joined: 05 Oct 2022
  • Loc: Concord, NC

Posted 08 January 2023 - 04:13 PM

I should note that my grasp of the obvious is astounding. My grasp of most of this electronic-speak is markedly less than that. Somebody needs to make these things and sell them to dummies like myself.


  • FrankyG, telesonic and fdboucher like this

#105 alanbc

alanbc

    Sputnik

  • -----
  • Posts: 32
  • Joined: 27 Nov 2022

Posted 08 January 2023 - 06:20 PM

Here is v5.10 (five dot ten) of the ESP32 Arduino code for this project.

Is there an updated schematic available to match this code?

 

I made up my own PCB based on your schematic of Nov 28/29.  (I had a NEO7 GPS module in the spare parts bin, a few ESP32 modules laying around .. not quite the same as yours, but close enough .. and a nice plastic case just the right size.)

 

I then used the firmware version of the day .. 4.8, IIRC .. and was happy to see it compile and flash.

 

Only yesterday though, I finally got around to soldering everything up.  But I haven't actually powered it up yet.

 

Instead, I decided to read more of this thread, having ignored it for a month or more, and now find a whole bunch of changes.  The SW is 12 versions newer, the GPS pins have changed, the switch pin has changed, a relay has been added as has support for some sort of joystick.

 

I am frankly at a loss as to what to do next.  Flash something newer, go with what I have, make up a whole new PCB based on your new hardware, or ...

 

In fact, even if I power it up as is, I'm not sure what to do next ...

 

Any thoughts appreciated.


  • TylerIv likes this

#106 mlord

mlord

    Cosmos

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

Posted 08 January 2023 - 06:34 PM

The HomeBrew Gen3 schematic is shown on the 3rd post of this very thread:  https://www.cloudyni.../#entry12343255

 

The code for the Gen3 will work on all prior versions of HomeBrew WiFi projects, but you will have to edit the "#define .. _PIN" lines in the code to match what your older hardware uses.  Other than that, it should all work as well as it ever did.

 

The "Relay" is a mode of operation, rather than a physical electro-mechanical device.  smile.gif

 

EDIT:  These are the "_PIN" lines that have to match how it is wired:

 

#define AUXBUS_RX_PIN               16  // (RX2) from AUX bus RX pin
#define AUXBUS_TX_PIN               17  // (TX2) to AUX bus TX pin
#define AUXBUS_BUSYIN_PIN           35  // was 19; from AUX bus BUSY pin (could be same pin as BUSYOUT)
#define AUXBUS_BUSYOUT_PIN          32  // was 19; to   AUX bus BUSY pin (could be same pin as BUSYIN)
#define GPS_TX_PIN                  33  // was 22; TX-to-GPS pin.   GPS RX Pin (green) connects here.
#define GPS_RX_PIN                  25  // was 23; RX-from-GPS pin. GPS TX pin (white) connects here.
#define ESP32_WIFI_MODE_PIN         13  // was 5;  Ground for "Access Point" mode; float high for "Direct Connect"

 

Cheers


Edited by mlord, 08 January 2023 - 08:41 PM.


#107 mlord

mlord

    Cosmos

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

Posted 08 January 2023 - 06:39 PM

Speaking of which, here is v5.16 of the Arduino ESP32 code for this project.

 

[deleted -- newer version available below]

 

New here is support for using an attached Nunchuck (Nintendo Wii thumbstick controller) purely for the Celestron Focus Motor.

 

Normally, the Nunchuck does 2-axis slewing of the mount, and controls focus instead only when Button-C is held in.  For this new mode, if enabled at build time, it ONLY handles Focus.  The buttons become "memory presets" for focus positions, and operate similarly to how car radio preset buttons work.

 

Cheers


Edited by mlord, 08 January 2023 - 11:51 PM.


#108 mlord

mlord

    Cosmos

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

Posted 08 January 2023 - 11:52 PM

Here is v5.17 of the Arduino ESP32 code for this project.

 

A minor update:  be smarter when blinking the BLUE LED as part of the auxtest.

 

Attached File  esp32_wifi.ino.v5.17.txt   76.1KB   74 downloads



#109 alanbc

alanbc

    Sputnik

  • -----
  • Posts: 32
  • Joined: 27 Nov 2022

Posted 09 January 2023 - 10:56 PM

The HomeBrew Gen3 schematic is shown on the 3rd post of this 

Thank you for your patience.

 

I did not see that image!  I carefully read (I thought) every post from where I left off some weeks ago and did not see it.  I don't know if it was caching or cookies or some weirdness in my (rarely rebooted) tablet, but your post wasn't there.

 

Thankfully, the new schematic looks pretty much like what I built, save for the extra switch.

 

As to what pins are used on the ESP32, I understand the issue.

 

Thanks again.

 

Alan


  • mlord likes this

#110 alanbc

alanbc

    Sputnik

  • -----
  • Posts: 32
  • Joined: 27 Nov 2022

Posted 11 January 2023 - 02:01 PM

OK, I have my version of Gen3 5.17 built and code compiled and uploaded.  Defines are as follows

 

VERBOSE                                    true  
AUXRELAY_ENABLED                false
MOUNTUSB_ENABLED              false 
GPS_ENABLED                           true 
BLOCK_CFM_CONNECTIONS   true 
NUNCHUCK_ENABLED              false 
NUNCHUCK_FOCUS_ONLY       false

 

My GPS module is not the recommended one, but a NEO7M.  But it's been configured to run at 9600 BPS, and it IS outputting the expected NMEA0183 sentences (GPRMC, GPGLL, etc.)  However, it never gets a valid fix as it's inside the house.

 

The ESP32 is connected to a PC via the onboard ESP32 USB port.

 

Upon powering up the CGEM II, I get a whole lot of auxbus_rx messages  (3b 03 0d 11 05 da, etc.), maybe 30 or so.

 

Then I get the message UDP Broadcast repeated, seemingly forever

 

UDP Broadcast

UDP Broadcast

UDP Broadcast

 

And that's it.

 

Is this expected?  Am I doing something wrong?  I'm not sure where to go next ...



#111 mlord

mlord

    Cosmos

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

Posted 11 January 2023 - 02:11 PM

Looks normal for when VERBOSE is forced to true.  No need to have it forced true at build time though, as you can toggle it on the fly by entering the letter 'v' at the Arduino Serial Monitor prompt.

 

Note that the recommended Beitian BN-180 GPS units do get a fix inside my house.  Never managed that with a NEO branded one though, probably because most of those are fakes.

 

Cheers


Edited by mlord, 11 January 2023 - 02:18 PM.


#112 mlord

mlord

    Cosmos

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

Posted 11 January 2023 - 02:13 PM

I'm not sure where to go next ...

Install SkyPortal on a smartphone or tablet, connect that device to the HomeBrew-xxxxxx WiFi, tell it to STAY connected (maybe "forget" the home WiFi for now), and then run SkyPortal in Direct Connect mode.

 

Oh, and after powering on the ESP32 and mount, you should see the blinky LED (usually BLUE) flash three times on the ESP32, indicating all is well.


Edited by mlord, 11 January 2023 - 02:16 PM.


#113 alanbc

alanbc

    Sputnik

  • -----
  • Posts: 32
  • Joined: 27 Nov 2022

Posted 11 January 2023 - 02:32 PM

Note that the recommended Beitian BN-180 GPS units do get a fix inside my house.  Never managed that with a NEO branded one though, probably because most of those are fakes.

Fakes, great ...

 

Well, the GPS module DOES work outside, so if it ever stops raining around here (May, maybe, possibly June), I'll take it outside and try it.

 

When I do, is there any indication that the ESP32 is receiving (valid) GPS position data?



#114 alanbc

alanbc

    Sputnik

  • -----
  • Posts: 32
  • Joined: 27 Nov 2022

Posted 11 January 2023 - 02:35 PM

Install SkyPortal on a smartphone or tablet, connect that device to the HomeBrew-xxxxxx WiFi, tell it to STAY connected (maybe "forget" the home WiFi for now), and then run SkyPortal in Direct Connect mode.

 

Oh, and after powering on the ESP32 and mount, you should see the blinky LED (usually BLUE) flash three times on the ESP32, indicating all is well.

Skyportal, will do.

 

As to the blue LED, after powerup, it comes on solid for about two seconds, blinks twice, then stays on solid.

 

Onnnnnnn

off

on

off

on

off

Onnnnnnnnn ...

 

Is this the expected three blinks?



#115 alanbc

alanbc

    Sputnik

  • -----
  • Posts: 32
  • Joined: 27 Nov 2022

Posted 11 January 2023 - 03:05 PM

Skyportal, will do.

Well, Sky Portal seems to be doing what's expected of it; slewing the scope around during an alignment process and moving to a selected star once aligned.  I suppose that means it's working!

 

However, this does lead to a couple of very naive questions.

 

1. Does this combination of Gen3 and Sky Portal mean I don't actually need the hand controller?

 

2. If I only use the Gen3 device and Sky Portal, does that mean I don't really need a GPS unit?  (The app seems to get time and position from the tablet.)

 

I get that if I find myself with no tablet, of course things are different.  I'm just trying to understand what's going on in front of me, what the capabilities are of what you've designed for me.



#116 Wyphy

Wyphy

    Vostok 1

  • *****
  • Posts: 156
  • Joined: 27 Jul 2015
  • Loc: Kansas

Posted 11 January 2023 - 03:58 PM

1 - That is technically correct, you don't require the HC, however, it's very handy to tweak the slewing if you're slightly off, and you enjoy the tactile button experience.

2 - Technically that is also correct, as the apps use the phone/tablet time and location, but as you say, without the apps, it is useful.

 

Something to remember too is that the mount remembers the last location, so if you set up in the same place (some say 20 mile radius), you only need to set the time, and even that doesn't technically need the ms accuracy that GPS provides; just use your phone, watch, whatever.

 

-----

Also, the Homebrew does shut off the GPS after a time (a few minutes, Mark can give an exact answer), so it doesn't really affect the power consumption if you leave it enabled in the software.


Edited by Wyphy, 11 January 2023 - 04:02 PM.


#117 mlord

mlord

    Cosmos

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

Posted 11 January 2023 - 04:00 PM

If using an app (SkyPortal, or SkySafari+/pro), then the hand-controller is not needed for anything.  Though some prefer to keep it plugged in just so they can use the arrow-buttons for slewing and the Focus Motor (if equipped).  I prefer a Nunchuck instead, plugged into the HomeBrew Gen3.  Either is better than trying to slew on a touchscreen. 

 

The GPS is also completely redundant, though some apps (eg. CPWI) will use it for even more accuracy.



#118 mlord

mlord

    Cosmos

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

Posted 11 January 2023 - 04:02 PM

Onnnnnnn

off

on

off

on

off

Onnnnnnnnn ...

 

Is this the expected three blinks?

Not quite, but probably okay.  Using the recommended 30-pin ESP32-DevKit-v1 module, the BLUE LED will blink three times and then TURN OFF at the end.  Dunno what happens with other ESP32 boards.
 

It sounds like the LED polarity is reversed on your ESP32 module.  You can edit the code to turn it off at the end if you want.


Edited by mlord, 11 January 2023 - 04:07 PM.


#119 mlord

mlord

    Cosmos

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

Posted 11 January 2023 - 04:11 PM

.. is there any indication that the ESP32 is receiving (valid) GPS position data?

If the hand-controller "sees" the GPS (have to manually enable that) then you know it is working.  Or, connect the USB cable to a PC, fire up the Arduino IDE, and hit 'g' and then ENTER in the Serial Monitor.  Enter it again to stop the spewing.. smile.gif

 

When it gets a "fix" eventually, the BN-180 will blink its red LED, and the HomeBrew Gen3 will tell the GPS to go to sleep after a couple of minutes.  On the recommended BN-180 GPS module, this results in the LEDs turning off and staying off until next time it is woken up.

 

EDIT;  And, oh, CONGRATULATIONS on getting the device working!  :)


Edited by mlord, 11 January 2023 - 04:17 PM.


#120 alanbc

alanbc

    Sputnik

  • -----
  • Posts: 32
  • Joined: 27 Nov 2022

Posted 11 January 2023 - 08:23 PM

It sounds like the LED polarity is reversed on your ESP32 module. 

I think you're right!  It never occurred to me that the boards would be different ...



#121 mlord

mlord

    Cosmos

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

Posted 13 January 2023 - 11:44 AM

I think you're right!  It never occurred to me that the boards would be different ...

Here's an interim version of the sketch that makes it easy to change the LED polarity.  Just find the line with "#define LED_ON" and change the value from HIGH to LOW.
 

Attached File  esp32_wifi.ino.v5.17+.txt   76.49KB   39 downloads


Edited by mlord, 13 January 2023 - 11:44 AM.


#122 Chote

Chote

    Viking 1

  • -----
  • Posts: 546
  • Joined: 31 Oct 2005
  • Loc: Bangkok, Thailand

Posted 15 January 2023 - 08:09 AM

Just seen this post with excitement. Will it work with 6SE Starsense?



#123 mlord

mlord

    Cosmos

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

Posted 15 January 2023 - 08:11 AM

Just seen this post with excitement. Will it work with 6SE Starsense?

Yes. 



#124 mlord

mlord

    Cosmos

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

Posted 15 January 2023 - 11:09 AM

Here is v5.18 of the Arduino ESP32 source code for this project.  Just minor tweaks in this one, no need to rush and update if you don't feel like it:

 

* Version 5.18
*  -- Make it easier to adjust the LED polarity for boards that have it wired differently.
*  -- Fix (harmless) SPIFFS error that shows up after initial flashing.
*  -- Add code to help with testing the MUSB switch on newly assembled modules.

 

Attached File  esp32_wifi.ino.v5.18.txt   77.02KB   78 downloads

 

That last change makes it easier to know if the Mount-USB selection switch is functional or not.  I wanted that here today because I was assembling a small batch of HomeBrew Gen3a modules for some friends.  Being able to just toggle the switch up and down and get feedback on the Serial Monitor makes it much easier to test the hardware.

 

5x.jpg


Edited by mlord, 15 January 2023 - 12:25 PM.

  • tjay, SieglindeFestkochend and fdboucher like this

#125 fdboucher

fdboucher

    Mariner 2

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

Posted 16 January 2023 - 03:07 PM

I'm very excited about this controller!

 

I just ordered a Nunchuk to work with the HBG3. How amazing! That would replace the HC altogether, right?

 

Do I need to alter the program listing?

#define NUNCHUCK_ENABLED          true  // Enables use of a Nunchuck game controller on I2C for slew/focus.
#define NUNCHUCK_FOCUS_ONLY       false // true for Focus presets instead of slew controls

Or is it automatically detected?

 

And how does one update the software on the controller?

 

Sorry: I'm a newbie to all this… but I usually "get it" quite fast… Thank you!


  • CuriousMark likes this


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