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

#151 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 06 February 2023 - 11:12 PM

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

 

Attached File  esp32_wifi.ino.v5.21.txt   81.49KB   61 downloads

 

This one incorporates a number of improvements to the Nunchuck code, to deal with imperfectly centred Nunchucks, including all of the following:

 

Version 5.21:
 -- Nunchuck: Improve range calculations for cases where calibration min/max are different amounts from centre.
 -- Nunchuck: Handle calibration data where min/max are zero but centre point appears to be valid.
 -- Nunchuck: Measure actual centre point, and redo calculations if it doesn't match the earlier (calibration) values.

Version 5.20:
-- Nunchuck: Use calibration data if it appears to be valid.

Version 5.19:
 -- Handle Nintendo-branded Nunchucks with more limited movement range.


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

  • SieglindeFestkochend likes this

#152 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 07 February 2023 - 08:24 AM

A wiring problem has been identified with using the passive WiiChuck style of connector for a Nunchuck.

 

wiichuck.jpg

 

Depending upon luck-of-the-draw with the specific Nunchuck used, use of this adapter may result in random movements of the mount.  The issue is that it does not provide the required pull-up resistors for the SDA/SCL signals used to communicate with it.  And the HomeBrew Gen3x boards do not provide them either.

 

So to make those connectors work reliably, one has to solder on two extra resistors.  Anything from 3.3K to 10K will work (4.7K recommended).  One must be placed  between the +3.3 and SDA line, and the other between the +3.3V and SCL line.  Those lines are labelled as "d" and "c" in the above photo.

 

When I test things here, everything works perfectly without the resistors (of course!), because the Nunchuck clone I happened to get has them built-in (rare).  It is much better to add them, to the end of that little WiiChuck adapter board.

 

adafruit.jpg

 

EDIT:

Anyone using the AdaFruit adapter (above)  might be fine as-is.  That one has on-board 10K pull-up resistors on those two signals, but only when powered using the VIN pin.  When powered via the 3V pin, the pull-ups are not in-circuit.  I will use 3.3V to the VIN pin from now on myself.

 

Cheers


Edited by mlord, 07 February 2023 - 08:54 AM.

  • bonanzaman likes this

#153 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 08 February 2023 - 01:29 PM

The HomeBrew Gen3b PCBs have arrived!  smile.gif

 

homebrew_gen3b.jpg

 

gen3b_with_nunchuck.jpg


  • Chote, tjay and fdboucher like this

#154 Paul Romero

Paul Romero

    Surveyor 1

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

Posted 08 February 2023 - 02:22 PM

Hi,

What an improvement over the standard hand controller!
Wish my Gen3A had the nunchuck connector and a nunchuck!

Clear skies,

Paul
  • fdboucher likes this

#155 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 08 February 2023 - 02:44 PM

The HomeBrew Gen3b PCBs have arrived!  smile.gif

.. as have the HomeBrew Standalone PCBs!  smile.gif

 

standalone.jpg

 

These can be used on their own, to interface pretty much any 3.3V microprocessor to the AUX bus (with appropriate firmware/software), or as shown below in combination with the Gen3b PCB to create a HomeBrew AUX Relay:

 

gen3b_standalone_relay.jpg

 

The HomeBrew AUX Relay was invented for use with old mounts, specifically the Nexstar GPS (NXGPS).  The Gen3b side (on the right above) gets plugged into either of AUX1 or AUX2 on the NXGPS, and the two new ports on the Relay side (left, above) provide connectivity for a StarSense AutoAlign camera and hand-controller, or pretty much any other AUX bus accessory.  Including those that would not normally work with the NXGPS.  Pins 2,4 of one of the two RJ12 jacks must be shorted together in this mode.

 

The built-in WiFi of the Gen3b also enables the NXGPS to work with SkySafari+/pro as well as with CPWI and other apps.  And the Gen3b has connectors for its own modern GPS receiver, and also for a Nunchuck thumbstick for slewing and focus adjustment.


Edited by mlord, 09 February 2023 - 10:00 AM.

  • tjay and 12Bass like this

#156 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 08 February 2023 - 02:49 PM

Wish my Gen3A had the nunchuck connector and a nunchuck!

The solder pads are there on the Gen3a just like on the Gen3b.  You only have to get an AdaFruit Nunchuck adapter and connect four wires between it and the Gen3a!  smile.gif


Edited by mlord, 08 February 2023 - 02:50 PM.


#157 tjay

tjay

    Gemini

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

Posted 08 February 2023 - 04:28 PM

.. as have the HomeBrew Standalone PCBs!  smile.gif

 

attachicon.gifstandalone.jpg

 

These can be used on their own, to interface pretty much any 3.3V microprocessor to the AUX bus (with appropriate firmware/software), or as shown below in combination with the Gen3b PCB to create a HomeBrew AUX Relay:

 

attachicon.gifgen3b_standalone_relay.jpg

 

The HomeBrew AUX Relay was invented for use with old mounts, specifically the Nexstar GPS (NXGPS).  The Gen3b side gets plugged into either of AUX1 or AUX2 on the NXGPS, and the two new ports on the Relay side provide connectivity for a StarSense AutoAlign camera and hand-controller, or pretty much any other AUX bus accessory.  Including those that would not normally work with the NXGPS.  Pins 2,4 of one of the two RJ12 jacks must be shorted together in this mode.

 

The built-in WiFi of the Gen3b also enables the NXGPS to work with SkySafari+/pro as well as with CPWI and other apps.

I hope my name is on one of these!


  • mlord and fdboucher like this

#158 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 08 February 2023 - 10:18 PM

I hope my name is on one of these!

It certainly is!  smile.gif

 

And there are extras now for others who may want to construct their own HomeBrew Gen3 accessory.  As well as a few pre-assembled ones.  Message me if interested.

 

mystery_object.jpg

 

(a very shaky cellphone photo from this evening -- the comet was just a grey smudge, so I looked for something more fun!)


Edited by mlord, 08 February 2023 - 10:19 PM.

  • tjay likes this

#159 masdeguzman

masdeguzman

    Lift Off

  • -----
  • Posts: 6
  • Joined: 02 Oct 2022

Posted 09 February 2023 - 04:09 PM

Would you have an updated parts list required for the Gen3b board?

 

Thank you,

Mike



#160 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 09 February 2023 - 04:21 PM

The list is the same for Gen3a/Gen3b:

 

-- one ESP32 DevKit-v1 30-pin processor board:

  https://www.aliexpre...1648850998.html

-- one RJ12 6P6C jack:

  https://www.digikey....00-003/14548962

-- one 5V DC-to-DC Buck (switching) converter:

  https://www.digikey....805-500/7350283

  https://www.aliexpre...3017156248.html (5V version)

-- one or two micro-size slider switches for WiFi mode and Mount-USB selection:

  https://www.aliexpre...3938407295.html (5mm SS-12D00G)

 

Plus a 6P6C AUX cable with RJ12 plugs wired as /R ("reverse"). Best to buy crimpers and connectors and make your own.  Commonly available ones tend to be VERY LONG.  Eg. https://www.digikey....6-B-7-R/1972588


Edited by mlord, 09 February 2023 - 04:24 PM.


#161 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 10 February 2023 - 08:15 AM

v5.21 has a sign-extension bug, which causes it not to recognize Nintendo-branded Nunchucks.

 

The new v5.22 of the Arduino ESP32 code for this project fixes that bug.

 

Attached File  esp32_wifi.ino.v22.txt   81.6KB   36 downloads



#162 masdeguzman

masdeguzman

    Lift Off

  • -----
  • Posts: 6
  • Joined: 02 Oct 2022

Posted 10 February 2023 - 10:32 AM

The list is the same for Gen3a/Gen3b:

 

-- one ESP32 DevKit-v1 30-pin processor board:

  https://www.aliexpre...1648850998.html

-- one RJ12 6P6C jack:

  https://www.digikey....00-003/14548962

-- one 5V DC-to-DC Buck (switching) converter:

  https://www.digikey....805-500/7350283

  https://www.aliexpre...3017156248.html (5V version)

-- one or two micro-size slider switches for WiFi mode and Mount-USB selection:

  https://www.aliexpre...3938407295.html (5mm SS-12D00G)

 

Plus a 6P6C AUX cable with RJ12 plugs wired as /R ("reverse"). Best to buy crimpers and connectors and make your own.  Commonly available ones tend to be VERY LONG.  Eg. https://www.digikey....6-B-7-R/1972588

Thank you sir! 



#163 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 11 February 2023 - 10:37 AM

Version v5.23 of the Arduino ESP32 source code is now available for this project:  Attached File  esp32_wifi.ino.v5.23.txt   82.46KB   58 downloads.

 

This version now has special Nunchuck debugging code included, which can be activated with the letter 'n' on the Serial Monitor.

 

A note about updating firmware for the HomeBrew Gen3:   I also provide a pre-built binary image (currently v5.23), along with the flashing tool and instructions here:   https://rtr.ca/teles...stuff/flashing/

 

Many people may find that method easier than trying to install/configure the Arduino IDE and libraries etc.  Please give it a try even if you already have installed the Arduino stuff -- I'd like some feedback on how to further simplify it.

 

EDIT: Fixed a broken link on the flashing page above.


Edited by mlord, 11 February 2023 - 11:25 AM.

  • Chote likes this

#164 Chote

Chote

    Viking 1

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

Posted 11 February 2023 - 10:21 PM

Got a compilation error with 5.23

C:\Users\axath\Documents\Arduino\Homebrew_esp32_wifi.v5.23\Homebrew_esp32_wifi.v5.23.ino: In function 'void auxtest_send_msg(bool)':
C:\Users\axath\Documents\Arduino\Homebrew_esp32_wifi.v5.23\Homebrew_esp32_wifi.v5.23.ino:1585:40: error: 'DEV_GET_VER' was not declared in this scope
   byte msg[] = {DEV_ESP32, DEV_AZM_MC, DEV_GET_VER};
                                        ^
C:\Users\axath\Documents\Arduino\Homebrew_esp32_wifi.v5.23\Homebrew_esp32_wifi.v5.23.ino: In function 'byte packet_decoder(rxbuf_s*, byte)':
C:\Users\axath\Documents\Arduino\Homebrew_esp32_wifi.v5.23\Homebrew_esp32_wifi.v5.23.ino:1654:80: error: 'DEV_GET_VER' was not declared in this scope
   if (target == DEV_ESP32 && rxbuf->data[2] == DEV_AZM_MC && rxbuf->data[4] == DEV_GET_VER)
                                                                                ^
exit status 1
Compilation error: 'DEV_GET_VER' was not declared in this scope


#165 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 11 February 2023 - 10:30 PM

Got a compilation error with 5.23

Must have changed the file or had a download issue.  The original file compiles correctly without error.  The DEV_GET_VER definition is there on line 812.



#166 Chote

Chote

    Viking 1

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

Posted 11 February 2023 - 11:05 PM

If I changed the gps enabled command to false, it produced the above error. I had to revert it to true

#define GPS_ENABLED               true  // When false, GPS code is completely left out.

I also tested the flash tool, but did not use your compiled code because I need to amend pin numbers (different for coolick's board). I compiled it with Arduino IDE 2 by Sketch--->Export compiled library; then it produced a xxx.bin file which I used to flash with the flash tool. The flash seems successful; but the serial monitor on Arduino showed errors. Pls see my screenshots.

Update: I may have to compile or flash it differently? because I saw two xxx.bin output files

Homebrew_esp32_wifi_5.23.ino.bin (I flashed with this file only)

Homebrew_esp32_wifi_5.23.ino.partitions.bin

 

esp32_flash_screenshot.jpg

 

esp32_flash_error_screenshot.jpg


Edited by Chote, 12 February 2023 - 12:27 AM.


#167 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 11 February 2023 - 11:17 PM

If I changed the gps enabled command to false, it produced the above error.

Right, so you did change the program.  :)

 

I'll fix the compilation for GPS_ENABLED=false next time there's a release.

 

Thanks.


  • Chote likes this

#168 Chote

Chote

    Viking 1

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

Posted 12 February 2023 - 05:46 AM

With Arduino 2.0.3 command: Sketch--->Export Compiled Binary, it produced 3 files as seen on the right pane.

With Arduino 2.0.3 command: Sketch--->Upload, it automatically compiled and uploaded 4 files as seen on the left pane, including flash starting address for each file. Those two files seem to be the two dot bin files on the right pane.

 

So I'm not sure what are the other two files it uploaded automatically.

 

With flash tool, can we just upload those two bin files at the address 0x00010000 and 0x00008000? or we simply flash the main bin file at starting address 0x00010000?

Or I'm totally wrong here.

 

 

Arduino_upload_VS_Export_compiled.jpg


Edited by Chote, 12 February 2023 - 05:52 AM.


#169 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 12 February 2023 - 09:07 AM

Version v5.23 of the Arduino ESP32 source code is now available for this project:  attachicon.gifesp32_wifi.ino.v5.23.txt.

...

I also provide a pre-built binary image (currently v5.23), along with the flashing tool and instructions here:   https://rtr.ca/teles...stuff/flashing/

 

Many people may find that method easier than trying to install/configure the Arduino IDE and libraries etc.  Please give it a try even if you already have installed the Arduino stuff -- I'd like some feedback on how to further simplify it.

I don't know who here has tried that method (?), but I omitted a critical step when creating the .bin file, so it would NOT have worked as was.  FIXED.  Please try again!

 

The binary file is generated (by me) by selecting "Export Compiled Binary" from within the Arduino IDE.  Unfortunately, the exported binary produced by that is not actually useful for very much.  So I wrote a script to take the byproducts of that, and combine them to produce a usable binary file.

 

I just have to remember to run the script!  smile.gif


Edited by mlord, 12 February 2023 - 09:59 AM.

  • SieglindeFestkochend likes this

#170 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 12 February 2023 - 09:12 AM

With Arduino 2.0.3 command: Sketch--->Export Compiled Binary, it produced 3 files as seen on the right pane.

It produces a total mess is what it does!

 

I had forgotten about that step, but have updated the binary I produced earlier to one that will actually work.  The process for doing so is quite involved.  Here is a link to the script and supporting files I use under Linux:  https://rtr.ca/teles...ng/combiner.tgz

 

Message me if you want to discuss further.  I would rather not clog up this HomeBrew Gen3 thread with a technical discussion on how to use Arduino in general.

 

Thanks


Edited by mlord, 12 February 2023 - 09:14 AM.

  • Chote likes this

#171 SieglindeFestkochend

SieglindeFestkochend

    Explorer 1

  • -----
  • Posts: 77
  • Joined: 03 Apr 2020
  • Loc: Germany

Posted 13 February 2023 - 02:25 PM

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

 

attachicon.gifesp32_wifi.ino.v5.21.txt

 

Has anyone integrated the OLED code into this project?

If so, I am interested.

 

I've been working on the integration of the OLED code (from the Allinone) for some time now, but so far I'm stuck with a bug... I have the Homebrew Gen3a as an internal solution, which works perfectly. I would like to connect a display.



#172 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 13 February 2023 - 04:18 PM

Has anyone integrated the OLED code into this project?

I thought someone had posted about that earlier.  It's easy enough to integrate, and would just plug onto the built-in I2C connector -- same pinout as the All-In-One.



#173 coollick

coollick

    Explorer 1

  • -----
  • Posts: 64
  • Joined: 21 Feb 2021
  • Loc: Ottawa, Canada

Posted 14 February 2023 - 10:14 PM

OLED code sure, here is v5.23 + OLED support from all-in-one

 

Pretty much copy/paste with minor adjustments (gps is coded slightly different)

Requires library SSD1306Ascii

All added code is wrapped in conditional compilation.

 

Compiles fine with true or false but I have not tested it, waiting for some parts to build mine.

I'm fairly confident that it should work.

On my initial build I had one but removed it because it was too bright and didn't find it very useful.
One could add an on-off switch for the display or hide it after alignment.

Set this line to true

#define OLED_ENABLED     false  // When true, OLED support is included and used for GPS information

Cheers!

Attached Files


  • SieglindeFestkochend likes this

#174 SieglindeFestkochend

SieglindeFestkochend

    Explorer 1

  • -----
  • Posts: 77
  • Joined: 03 Apr 2020
  • Loc: Germany

Posted 15 February 2023 - 08:01 AM

OLED code sure, here is v5.23 + OLED support from all-in-one

 

Pretty much copy/paste with minor adjustments (gps is coded slightly different)

Requires library SSD1306Ascii

All added code is wrapped in conditional compilation.

 

Compiles fine with true or false but I have not tested it, waiting for some parts to build mine.

I'm fairly confident that it should work.

On my initial build I had one but removed it because it was too bright and didn't find it very useful.
One could add an on-off switch for the display or hide it after alignment.

Set this line to true

#define OLED_ENABLED     false  // When true, OLED support is included and used for GPS information

Cheers!

Thank you for your customized oled version!

 

Everything works perfectly. I'll compare my attempt with your adjustments and learn from it.

 

If the display is too bright: you can bring a red film over the display. There are also fairly thick red foils that make the display very dark.

There are also oled-displays in red, which are (at least here) significantly more expensive than the white one.

 

In my case, with the internal solution, the display is housed under the battery cover. Again, I used a red foil.

 

My esp32-Board https://www.makersho...-dev-kit-board/ needs LOW in the line 97

 

 

Thanks says Michael


Edited by SieglindeFestkochend, 15 February 2023 - 08:15 AM.

  • coollick likes this

#175 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 6,532
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada.

Posted 16 February 2023 - 12:38 AM

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

With a bit of luck, this may actually now work with Nintendo-branded Nunchuck controllers.  smile.gif

 

* Version 5.24
*  -- Nunchuck: Use a centre-range rather than a single centre-point for X and Y axis.
*  -- Nunchuck: Fix BUG where calibration data wasn't being read unless in debug mode. Duh.
*  -- Fix compilation for GPS_ENABLED=false

 

Source code:   Attached File  esp32_wifi.ino.v5.24.txt   83.45KB   36 downloads

Binary for simpler flashing:  https://rtr.ca/teles...stuff/flashing/

 


  • Chote 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