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

#76 scopewizard

scopewizard

    Surveyor 1

  • *****
  • Posts: 1,520
  • Joined: 04 Oct 2010
  • Loc: Alberta, Canada

Posted 24 December 2022 - 12:24 PM

So far this morning I managed to install V5.1, V5.2 and 5.4 and they seems to work fine.

V5.6 has a BT error.

V5.7 did not work (error on loading, procedure "tx_eng")

V5.8, V5.9, V5.12 and V5.12+, all eventually failed on WIFI Client (all initially connect but eventually fail shortly after connection).

 

All were tested with GPS_ENABLED and BLOCK_CFM_CONNECTIONS as true and other as false



#77 mlord

mlord

    Fly Me to the Moon

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

Posted 24 December 2022 - 04:16 PM

Thanks.  I'll have a look when I get back to my telescope gear.

 

One thing I ought to have asked for up front:  capture a serial port trace of it dying.   (Arduino IDE Serial Monitor).

 

Thanks



#78 scopewizard

scopewizard

    Surveyor 1

  • *****
  • Posts: 1,520
  • Joined: 04 Oct 2010
  • Loc: Alberta, Canada

Posted 26 December 2022 - 11:05 AM

Thanks.  I'll have a look when I get back to my telescope gear.

 

One thing I ought to have asked for up front:  capture a serial port trace of it dying.   (Arduino IDE Serial Monitor).

 

Thanks

Here is the failure with Version 5.12+

I remove my IP and login with "x"

 

GPS On
HomeBrew-v5.12+: AUXRELAY=0 MOUNTUSB=0 GPS=1 BLOCK_CFM=1 SSFORWARD=0 NUNCHUCK=0
000001292 wifi_mode_switch: client_mode
wifi_begin_server_mode:
esp32_wifi ON, softAP, ssid=HomeBrew-A2F3E4, passkey=
esp32_wifi OFF
E (3315) wifi_init_default: esp_wifi_get_mac failed with 12289
esp32_wifi ON, Client mode
wifi_begin_client_mode:
GPS detected
000002655 auxbus_rx: 3b 07 10 e2 fe 07 11 00 19 d8
auxbus_rx: Received testmsg.

WiFi connected to xxxxxxx, IP address: xxx.xxx.x.xx
000003665 auxbus_rx: 3b 07 10 e2 fe 07 11 00 19 d8
auxbus_rx: Received testmsg.
000004675 auxbus_rx: 3b 07 10 e2 fe 07 11 00 19 d8
auxbus_rx: Received testmsg.
000041322 w2000 Connected
GPS GET_VER
GPS LINKED: false
GPS LINKED: false
evo_wifi OFF
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
000051520 w2000 Disconnected
000052889 w2000 Connected
000070021 w2000 Disconnected
evo_wifi ON



#79 scopewizard

scopewizard

    Surveyor 1

  • *****
  • Posts: 1,520
  • Joined: 04 Oct 2010
  • Loc: Alberta, Canada

Posted 26 December 2022 - 11:09 AM

Second test, a little long after disconnecting,

 

The final disconnection is when I cancelled CPWI.

 

 

GPS On
HomeBrew-v5.12+: AUXRELAY=0 MOUNTUSB=0 GPS=1 BLOCK_CFM=1 SSFORWARD=0 NUNCHUCK=0
000001294 wifi_mode_switch: client_mode
wifi_begin_server_mode:
esp32_wifi ON, softAP, ssid=HomeBrew-A2F3E4, passkey=
esp32_wifi OFF
E (3319) wifi_init_default: esp_wifi_get_mac failed with 12289
esp32_wifi ON, Client mode
wifi_begin_client_mode:
GPS detected
000002657 auxbus_rx: 3b 07 10 e2 fe 07 11 00 19 d8
auxbus_rx: Received testmsg.

WiFi connected to xxxxxxx, IP address: xxx.xxx.x.xx
000003667 auxbus_rx: 3b 07 10 e2 fe 07 11 00 19 d8
auxbus_rx: Received testmsg.
000004677 auxbus_rx: 3b 07 10 e2 fe 07 11 00 19 d8
auxbus_rx: Received testmsg.
000023326 w2000 Connected
GPS GET_VER
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
evo_wifi OFF
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
000040608 w2000 Disconnected
000040749 w2000 Connected

GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
000046345 w2000 Disconnected
000047386 w2000 Connected
GPS GET_VER
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
000074731 w2000 Disconnected
evo_wifi ON


Edited by scopewizard, 26 December 2022 - 11:12 AM.


#80 mlord

mlord

    Fly Me to the Moon

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

Posted 26 December 2022 - 11:35 AM

Nothing unusual there. It really looks like the remote end is disconnecting.

#81 scopewizard

scopewizard

    Surveyor 1

  • *****
  • Posts: 1,520
  • Joined: 04 Oct 2010
  • Loc: Alberta, Canada

Posted 26 December 2022 - 11:46 AM

Nothing unusual there. It really looks like the remote end is disconnecting.

Here is the direct connection, it stays connected.

 

000137733 wifi_mode_switch: server_mode
esp32_wifi OFF
esp32_wifi ON, Server mode
wifi_begin_server_mode:
esp32_wifi ON, softAP, ssid=HomeBrew-A2F3E4, passkey=
GPS On
HomeBrew-v5.12+: AUXRELAY=0 MOUNTUSB=0 GPS=1 BLOCK_CFM=1 SSFORWARD=0 NUNCHUCK=0
000001310 wifi_mode_switch: server_mode
esp32_wifi ON, Server mode
wifi_begin_server_mode:
esp32_wifi ON, softAP, ssid=HomeBrew-A2F3E4, passkey=
GPS detected
000002469 auxbus_rx: 3b 07 10 e2 fe 07 11 00 19 d8
auxbus_rx: Received testmsg.
000003479 auxbus_rx: 3b 07 10 e2 fe 07 11 00 19 d8
auxbus_rx: Received testmsg.
000004489 auxbus_rx: 3b 07 10 e2 fe 07 11 00 19 d8
auxbus_rx: Received testmsg.
000044510 w3000 Connected
000044793 w3000 Disconnected
000044801 w2000 Connected
GPS GET_VER
GPS GET_VER
evo_wifi OFF
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false
GPS LINKED: false



#82 scopewizard

scopewizard

    Surveyor 1

  • *****
  • Posts: 1,520
  • Joined: 04 Oct 2010
  • Loc: Alberta, Canada

Posted 26 December 2022 - 11:53 AM

Version 5.4

 

no issues.

 

GPS On
HomeBrew-AMW007-9.0.0.0, 2022-12-07T12:00:00Z, ESP32-5.4
000001292 wifi_mode_switch: client_mode
esp32_wifi ON, Client mode
wifi_begin_client_mode:
gps_detected

WiFi connected to xxxxxxx, IP address: xxxxxxxxxx
Sending:  000002892 auxbus_rx: 3b 07 10 e2 fe 07 11 00 19 d8
auxbus_rx: Received testmsg.
Sending:  000003903 auxbus_rx: 3b 07 10 e2 fe 07 11 00 19 d8
auxbus_rx: Received testmsg.
Sending:  000004913 auxbus_rx: 3b 07 10 e2 fe 07 11 00 19 d8
auxbus_rx: Received testmsg.
000018302 w2000 Connected
GPS GET_VER
GPS LINKED: false
GPS LINKED: false


Edited by scopewizard, 26 December 2022 - 11:53 AM.


#83 mlord

mlord

    Fly Me to the Moon

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

Posted 26 December 2022 - 01:46 PM

Capture a trace with VERBOSE on. Not useful without. And I care only about the latest code, thanks. Please message it to me rather than polluting this thread. And nuke the earlier ones. Thanks.

#84 mlord

mlord

    Fly Me to the Moon

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

Posted 26 December 2022 - 05:51 PM

..meanwhile, I'm back "in the office" now.  So I can re-test with Client mode and stuff to see what happens here. 

 

It would be HELPFUL to know what software/app you are having difficulty with.  Exact version number, please.  And also the exact version number of the Arduino ESP32 support that is being used to build the firmware.



#85 mlord

mlord

    Fly Me to the Moon

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

Posted 29 December 2022 - 01:52 PM

Somebody asked me today for an AUX port Ethernet dongle.  So I made one up using the new HomeBrew Gen3a PCB, but with an Arduino Pro Micro processor board, along with the usual WizNet W5500 Ethernet module.  This is now described with photos in the Ethernet thread:   https://www.cloudyni...8#entry12385900

 

05_working.jpg



#86 mlord

mlord

    Fly Me to the Moon

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

Posted 30 December 2022 - 09:40 AM

The question of power consumption came up today in another thread, and I am reposting the information here where it is even more relevant:

 

The HomeBrew Gen3 gets its power from the mount.  The amount of power used, depends upon which features are in use at any time.  Eg. it turns off WiFi when a different connection method is in use.

 

I set up an ammeter between the 12V AUX and a basic HomeBrew Gen3 with WiFi+BT.  Using the WiFi connection gives a total draw of 62mA from the 12V AUX.  Switching to Bluetooth, this drops to about 55mA.

 

Converting that to watts:  12 x .062 = 0.74watts for WiFi, and 12 x .055 = 0.66watts for Bluetooth.

I did not measure Mount-USB consumption, but it should be about the same as using Bluetooth.

 

For comparison, my Nexstar+ (USB) hand-controller draws 68mA at idle (.82watts).

 

Note that I measured 11.96V on the AUX, so actual power usage was slightly less than calculated above.

 

For Mount-USB, it should be easy to modify the Gen3 design to draw power ONLY from the USB connection, rather than from the mount:  just add a switch to disable the 12V input from AUX, or don't populate the 5V Buck and diode.


Edited by mlord, 30 December 2022 - 09:41 AM.

  • servitecnic3999 likes this

#87 mlord

mlord

    Fly Me to the Moon

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

Posted 31 December 2022 - 03:24 PM

Here is v5.13 of the Arduino ESP32 code for this project.  This version improves compatibility with CPWI 2.4.3-beta11 when a GPS receiver is attached to the HomeBrew module.

 

Attached File  esp32_wifi.ino.v5.13.txt   73.98KB   60 downloads

 

The fix is to guarantee that internally-handled GPS messages are responded to in correct sequence with other AUX requests from the remote client.  So they have to be queued with the rest and responded to only after the others have been processed.  And not too quickly either, or CPWI misses them.  This required a bit more code restructuring, but seems to be working fine now.

 

The auxtest code has also been updated for tidier messaging on the Serial Monitor now.

 

Happy New Year!   band2.sml.gif


  • tjay likes this

#88 Stooks

Stooks

    Lift Off

  • -----
  • Posts: 2
  • Joined: 31 Dec 2022

Posted 01 January 2023 - 12:51 AM

Greetings. Great work by Mark and everyone that has contributed to this project.

I'm a carpenter with very little programming ability. Soldering I can do however. How would either myself or someone like me be able to acquire the PCB or would the electrical schematic be what's needed to have a PCB made?
  • Paul Romero and mlord like this

#89 mlord

mlord

    Fly Me to the Moon

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

Posted 01 January 2023 - 08:59 AM

I haven't found any place that will do single boards with the surface-mounted parts pre-soldered at anything near affordable pricing.  So I had a batch of Gen3a PCBs made up with pre-soldered parts, and now distribute them.  Message me for details.


Edited by mlord, 01 January 2023 - 09:12 AM.


#90 mlord

mlord

    Fly Me to the Moon

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

Posted 01 January 2023 - 04:40 PM

Today I wired up a HomeBrew AUX Relay using a pair of Gen3a PCBs.  Here's what it looks like, next to one I had previously wired up with the earlier/larger Gen3 PCBs:

 

r1.jpg r2.jpg

 

As usual, it took me two tries to get my head around which wires go where between the two boards.  There are only four of them:  Rx,Tx,BusyIn,BusyOut, but my brain gets twisted trying to put them in the right places.  If I ever do another production run of PCBs, they'll have extra silk-screen labels to make that easier for me!  smile.gif

 

Actually, there are seven wires in all, not just the four above.  The other three are +12V, +5V, and GND.  Those are easier to get right!  smile.gif

 

After I finally got it wired correctly, it still took another hour for me to get the Relay working.  Wait a minute.. been there before.. same issue with the first one I built.. Doh!  Forgot (again!) to hardwire RX/TX together at the RJ12 jack on the Relay side, just like the mount itself does on the primary side of the Relay.

 

rxtx.jpg

 

Must remember that next time..

 

I also wired up the Mount-USB selection switch, forgetting that this has no use on a Relay -- not enough hardware serial ports on the ESP32 for Mount-USB to work in this scenario.  So.. it has an extra switch on it, which I may use to select "testing mode" or something.  New source code will be released shortly, also fixing the build for when GPS_ENABLED=false.


Edited by mlord, 02 January 2023 - 10:59 AM.


#91 mlord

mlord

    Fly Me to the Moon

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

Posted 01 January 2023 - 05:27 PM

v5.14 of the Arduino ESP32 code for this project.

 

-- Fix building with GPS_ENABLED=false.

 

-- Use the MUSB switch to turn on forwarding of StarSense Camera packets across the Relay when AUXRELAY_ENABLED=true.  This is not turned on by default because it has not yet been (re-)tested on an older mount (eg. NXGPS).  So with it off, the StarSense Camera must be plugged into the same side of the Relay as the alignment device (eg. hand-controller).

 


Edited by mlord, 02 January 2023 - 01:37 PM.


#92 mlord

mlord

    Fly Me to the Moon

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

Posted 02 January 2023 - 01:36 PM

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

 

-- Fix use of attached GPS receiver with the hand-controllers.  Wasn't working before.

 

Attached File  esp32_wifi.ino.v5.15.txt   72.3KB   46 downloads


  • Paul Romero likes this

#93 mlord

mlord

    Fly Me to the Moon

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

Posted 02 January 2023 - 10:22 PM

Understandably, a number of people struggle to install the Arduino IDE and then build/download firmware for the HomeBrew Gen3/Gen3a device.  Here is an alternative method, that uses only the Espressif flash downloader:

 

   https://rtr.ca/teles...stuff/flashing/

 

If a few of you could try that method and report back here on success or failure, or suggestions, it would be much appreciated.

 

The provided v5.15 image there was built using these options:

 

#define VERBOSE                   false // Can also be toggled at run-time (hit 'v' on serial monitor).
#define AUXRELAY_ENABLED          false // When false, AUXRELAY code is disabled.
#define MOUNTUSB_ENABLED          true  // When true, USB port can be used for Mount-USB (ground MOUNTUSB_SELECT_PIN at boot).
#define GPS_ENABLED               true  // When false, GPS code is completely left out.
#define BLOCK_CFM_CONNECTIONS     true  // Set to false to allow CFM to try and update firmware (VERY RISKY!!).
#define NUNCHUCK_ENABLED          true  // Enables use of a Nunchuck game controller on I2C for slew/focus.

 

If enough people give this a go and report back, I may expand the idea to also include pre-built images for the All-In-One and other configurations.


Edited by mlord, 03 January 2023 - 06:35 PM.


#94 Tom84

Tom84

    Lift Off

  • -----
  • Posts: 16
  • Joined: 08 Dec 2022
  • Loc: Germany

Posted 03 January 2023 - 05:46 AM

This looks really fantastic!

 

Would that homewbrew controller make it possible to use CPWI with a starsense HC on a HEQ5 (I've got Starsense for Skywatcher)?



#95 mlord

mlord

    Fly Me to the Moon

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

Posted 03 January 2023 - 08:31 AM

Would that homewbrew controller make it possible to use CPWI with a starsense HC on a HEQ5 (I've got Starsense for Skywatcher)?

Dunno.  It might work, but I don't have a lot of confidence in Celestron's own firmware engineers and whatever they may have done in the SS-for-SkyWatcher Relay/Bridge of their own.  smile.gif

 

For that matter, I don't know that it makes sense to continue to use the StarSense HC when one has a CPWI connection more directly to the mount, which is what this project provides.


Edited by mlord, 03 January 2023 - 09:04 AM.

  • Sakcyb likes this

#96 Paul Romero

Paul Romero

    Surveyor 1

  • *****
  • Posts: 1,810
  • Joined: 05 Apr 2005
  • Loc: Reno, NV

Posted 03 January 2023 - 09:36 PM

Hi all,
I’ve just setup my Homebrew with CPWI via a Mount -USB Bluetooth connection, but it has not been used to align my Nexstar 11 GPS yet. It looks very promising because with my windows tablet, CPWI provides a very easy to use interface for manual alignment! No more remembering what the locations are for offered alignment stars…just click on any of the suggested stars presented in the full color planetarium and the scope will slew near it. A very refined alignment model is possible, I believe.

Clear Skies,

Paul


Edited by Paul Romero, 03 January 2023 - 09:37 PM.

  • tjay and mlord like this

#97 Bartec

Bartec

    Explorer 1

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

Posted 04 January 2023 - 05:08 AM

Mark, good afternoon. I have a wish. You can add an LED to indicate the establishment of a connection with GPS satellites, as was done in the project on ARDUINO PRO MINI.



#98 Tom84

Tom84

    Lift Off

  • -----
  • Posts: 16
  • Joined: 08 Dec 2022
  • Loc: Germany

Posted 04 January 2023 - 05:38 AM

Dunno. It might work, but I don't have a lot of confidence in Celestron's own firmware engineers and whatever they may have done in the SS-for-SkyWatcher Relay/Bridge of their own. smile.gif

For that matter, I don't know that it makes sense to continue to use the StarSense HC when one has a CPWI connection more directly to the mount, which is what this project provides.


I would use the homebrew without the handcontroller via the splitterbox. Unfortunately, the starsense for skywatcher does not allow you to use cpwi. It says it doesn't recognise a celestron mount (HEQ5 with starsense for skywatcher). Therefore I thought your controller might be an option to use cpwi.

#99 mlord

mlord

    Fly Me to the Moon

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

Posted 04 January 2023 - 08:52 AM

You could try it.  It is very easy to modify the code to tell CPWI anything we want to tell it.  Eg. that you have an AVX or CGX mount instead an HEQ5, or whatever.

 

-ml


Edited by mlord, 04 January 2023 - 10:13 AM.


#100 mlord

mlord

    Fly Me to the Moon

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

Posted 04 January 2023 - 10:22 AM

Mark, good afternoon. I have a wish. You can add an LED to indicate the establishment of a connection with GPS satellites, as was done in the project on ARDUINO PRO MINI.

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.




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