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

#926 mlord

mlord

    Cosmos

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

Posted 07 December 2023 - 11:41 AM

Version v8.23 is now available for the HomeBrew Gen3 (HBG3):  Attached File  hbg3.ino.v8.23.txt   268.21KB   30 downloads

  • GPS: New NVRAM variable gps.force.saved.location to always use saved lat/lng when no better fix available.
  • GPS: Keep recent GPS Location data (in RAM) when sleeping the GPS, for replay on wake-up (still requires time/date fix).
  • GPS: Increase gps.idle.timeout from 10 minutes to 20 minutes, and allow NVRAM override.
  • GPS: Rename "disable.gps" to "gps.disable" for better consistency.
  • OLED: Show "HBG3 Idle" instead of "No Session".
  • OLED: Show "BT Session" instead of "BT Connected" when link is up but no activity.
  • OLED: Show ':' after lat/lng for real Location, '?' for saved Location, and '-' for recent Location.

Easiest way to update is to use the built-in ota_update command, or do it with the push-button and OLED.

Instructions on how to do it are here:  https://www.cloudyni...6#entry13084984

 

Cheers


Edited by mlord, 08 December 2023 - 09:35 AM.


#927 Rac19

Rac19

    Soyuz

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

Posted 07 December 2023 - 02:58 PM

I have a really basic question. I have not yet found a way to talk to HBG3 over WiFi/SSL. I can connect to the device (direct mode) and ping 1.2.3.4 but I get no response for "help" or "get all"

 

Is there a user name and password that I need to know?

 

Should I connect to port 2000 or port 3000.

 

I would really like to have access to the GPS changes in post #926 but obviously I need to configure my home network name and pass-phrase to update.

 

BTW, I have tried  a USB/serial connection with RealTerm but no luck there either.



#928 mlord

mlord

    Cosmos

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

Posted 07 December 2023 - 03:39 PM

Should I connect to port 2000 or port 3000.

Telnet to Port 3000 is the configuration port for Celestron WiFi dongles, so that's what the HBG3 uses as well.

 

Once connected, hit enter once, then enter the debug command to gain access to the HBG3 commands (normally one only gets the Celestron commands).

 

But this is also totally unnecessary.   Instead, use the SkyPortal app on, say, a smartphone.  Connect the smartphone to the HomeBrew-xxxxx SSID, and then run SkyPortal and hit CONNECT, and so on.  Full instructions have been posted here a few times recently now:  https://www.cloudyni...6#entry13084984


Edited by mlord, 08 December 2023 - 10:17 AM.

  • Rac19 likes this

#929 Rac19

Rac19

    Soyuz

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

Posted 07 December 2023 - 10:43 PM

Port 3000 is the configuration port for Celestron WiFi dongles, so that's what the HBG3 uses as well.

 

Once connected, hit enter once, then enter the debug command to gain access to the HBG3 commands (normally one only gets the Celestron commands).

 

But this is also totally unnecessary.   Instead, use the SkyPortal app on, say, a smartphone.  Connect the smartphone to the HomeBrew-xxxxx SSID, and then run SkyPortal and hit CONNECT, and so on.  Full instructions have been posted here a few times recently now:  https://www.cloudyni...6#entry13084984

Thanks Mark, SkyPortal was the quickest and surest was to configure my network name and pass-phrase. It must be 5 years or more since I gave up on SkyPortal due to the abysmal performance of the original Evo WiFi. Perhaps I could consider using it againconfused1.gif. Then again,CPWI is an integral part of my set up these days.

 

I now have HBG3 connected to my home network and hence the internet. After a few stalled attempts I was able to get an OTA upgrade to v8.23 to complete. Fortunately stalled attempts didn't seem to brick the HBG3, thanks to Mark's bullet proof programming, I assume.

 

I still can't get debug working but OTA did the job so I don't need to pursue that.


  • mlord likes this

#930 Rac19

Rac19

    Soyuz

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

Posted 08 December 2023 - 02:55 AM

I can report progress with the USB connection. I noticed that the micro-USB connection was only about half engaged. I plucked up the courage to push it VERY firmly and it clicked into place, fully engaged. Now CPWI connects successfully via the USB portwaytogo.gif

 

With half engagement, power (and I assume ground) was connected but not data, apparently.

 

When I connect RealTerm, HBG3 spews out strange characters, when has not happened before. I assume that this requires correct data rate, data bits, stop bits etc, to correct the problem.



#931 Rac19

Rac19

    Soyuz

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

Posted 08 December 2023 - 07:41 AM

There seems to be a problem with GPS at the moment (Friday night). The HBG3 OLED displays no GPS location or time data and the StarSense HC displays "Waiting for GPS". There was GPS signal a few hours ago. Tried my golf GPS and it seems to have similar issues, having worked earlier in the day.

 

I have just updated to HBG3 firmware v8.23 today and I am wondering why it is not using stored location data. Is it because I haven't saved location data since the update. Is the existing stored location data lost during an update.

 

I notice that v8.23 stores the location in NVRAM, which is apparently new. Would that include Saved location data.

 

I thought that this was worth reporting even though the lack of a valid time value means that the HC would be stuck on "Waiting for GPS" anyway.

 

EDIT: GPS just came back, just after I packed up for the night. The HB3 OLED now displays what look correct UTC. It has found about 25 satellites but not acquired any yet. When it has a valid position, I will save it for next time.


Edited by Rac19, 08 December 2023 - 07:59 AM.


#932 mlord

mlord

    Cosmos

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

Posted 08 December 2023 - 08:57 AM

When I connect RealTerm, HBG3 spews out strange characters, when has not happened before. I assume that this requires correct data rate, data bits, stop bits etc, to correct the problem.

Flip the (blue) USB switch DOWN, closest to the PCB.  After it finishes the subsequent automatic reset, connect to it using 115200 8N1

 

Cheers
 



#933 mlord

mlord

    Cosmos

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

Posted 08 December 2023 - 09:02 AM

Thanks Mark, SkyPortal was the quickest and surest was to configure my network name and pass-phrase. It must be 5 years or more since I gave up on SkyPortal due to the abysmal performance of the original Evo WiFi. Perhaps I could consider using it againconfused1.gif. Then again,CPWI is an integral part of my set up these days.

Oh, CPWI could also have been used for that, but I haven't written up any instructions for it.   SkyPortal is easy and works, though!

 

For connecting to the debug port, there are two choices:

  1. USB cable, with the blue MUSB switch DOWN closest to the PCB.  Connect using 115200 8N1.  There is no prompt, so just hit enter, type help and hit enter again.
  2. Telnet to port 3000 for the Celestron configuration interface (what SkyPortal uses to set SSID/passkey).  Once there, hit enter, type help and hit enter again for a list of commands.  One of those commands is debug which will then enable the rest of the HBG3-specific commands.

Cheers

Mark



#934 mlord

mlord

    Cosmos

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

Posted 08 December 2023 - 10:19 AM

GPS just came back, just after I packed up for the night. The HB3 OLED now displays what look correct UTC. It has found about 25 satellites but not acquired any yet. When it has a valid position, I will save it for next time.

Some days here, indoors in my office with solar panels above on the roof, GPS seems to take forever.  Other days, like Thursday this week, it was getting fixes in just a minute or so, on brand-new out-of-the-wrapper GPS modules.

 

Outdoors of course, it's nearly always quite quick.

 

Cheers
 


Edited by mlord, 08 December 2023 - 10:20 AM.


#935 Rac19

Rac19

    Soyuz

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

Posted 08 December 2023 - 03:27 PM

Flip the (blue) USB switch DOWN, closest to the PCB.  After it finishes the subsequent automatic reset, connect to it using 115200 8N1

 

Cheers
 

Actually, RealTerm seems to be doing something nasty to the Com port. After using it, CPWI won't communicate with the mount until I go into the Device Manager and Disable/Enable the port.



#936 mlord

mlord

    Cosmos

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

Posted 08 December 2023 - 03:30 PM

Actually, RealTerm seems to be doing something nasty to the Com port.

For COM ports or SSH, I use puTTY.
For telnet, I try and use native Windows telnet:  https://phoenixnap.c.../telnet-windows



#937 mlord

mlord

    Cosmos

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

Posted 09 December 2023 - 11:20 AM

HBG3 firmware v8.24 is now available: Attached File  hbg3.ino.v8.24.txt   268.46KB   21 downloads

  • Make Bluetooth SSID always the same as the WiFi SSID, aka "softap.ssid".
  • OTA: Fix timeout bugs.
  • OLED: Reduce button press timers by 0.5secs to match desired timeouts.

Binaries and full source archives are available in all of the usual places.

 

Cheers



#938 Rac19

Rac19

    Soyuz

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

Posted 09 December 2023 - 03:01 PM

For COM ports or SSH, I use puTTY.
For telnet, I try and use native Windows telnet:  https://phoenixnap.c.../telnet-windows

Thanks Mark had already tried PuTTY (same result as #935) and CMD Telnet and nothing seems to work. It's a mystery that I don't need to solve right now as HBG3 is doing what I need it to do.

 

One thing, with the HBG3 connected to my home network, I can see the assigned IP address on the OLED screen but I can't ping it and it isn't listed as connected. OTA update worked and it IS assigned an IP, so it must in fact be connected.


Edited by Rac19, 09 December 2023 - 03:03 PM.


#939 mlord

mlord

    Cosmos

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

Posted 09 December 2023 - 03:13 PM

.. with the HBG3 connected to my home network, I can see the assigned IP address on the OLED screen but I can't ping it and it isn't listed as connected. OTA update worked and it IS assigned an IP, so it must in fact be connected.

If it shows an IP address, then it is connected to the network.  The "No Connection" thing (or "HBG3 Idle" in latest firmware), means "no app is connected" (eg. SkySafari).  Update your firmware!!

 

It should be ping-able.  If not, the fault in this case is with the computer you are using, not the HBG3.  Or possibly the router -- many have a setting such as "client isolation" that would cause that kind of failure.


Edited by mlord, 09 December 2023 - 03:15 PM.

  • Hobiemark likes this

#940 Rac19

Rac19

    Soyuz

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

Posted 09 December 2023 - 03:36 PM

If it shows an IP address, then it is connected to the network.  The "No Connection" thing (or "HBG3 Idle" in latest firmware), means "no app is connected" (eg. SkySafari).  Update your firmware!!

 

It should be ping-able.  If not, the fault in this case is with the computer you are using, not the HBG3.  Or possibly the router -- many have a setting such as "client isolation" that would cause that kind of failure.

Thanks for the reply. I can ping everything else on the network which seems to rule out a computer or router issue. The router management software lists all devices on the network (connected or not) and their assigned IP addresses EXCEPT for HBG3, which is odd. I will see if I can find out why that might be.

 

It's not an urgent problem so I will put it on the back burner for now.



#941 Rac19

Rac19

    Soyuz

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

Posted 09 December 2023 - 04:30 PM

This might be of interest. The attached screenshot is from Net Analyser on my iPad. It seems to be finding the HBG3 (esp32-442f24.modem) but there are no ping response times , which normally appear on the right of the screen, as per the second image.

Attached Thumbnails

  • IMG_1461.jpeg
  • IMG_1462.jpeg

Edited by Rac19, 09 December 2023 - 04:34 PM.


#942 Rac19

Rac19

    Soyuz

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

Posted 09 December 2023 - 05:58 PM

This might be of interest. The attached screenshot is from Net Analyser on my iPad. It seems to be finding the HBG3 (esp32-442f24.modem) but there are no ping response times , which normally appear on the right of the screen, as per the second image.

I have at least a partial answer. The HBG3 has made it onto the DHCP lease table but was not actually connected. I think that this telescope was covered, due to rain. When the rain stops I will try again with the cover off.

Attached Thumbnails

  • IMG_1463.jpeg

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


#943 mlord

mlord

    Cosmos

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

Posted 09 December 2023 - 06:10 PM

I have at least a partial answer. The HBG3 has made it onto the DHCP lease table but was not actually connected. I think that this telescope was covered, due to rain. When the rain stops I will try again with the cover off.

Could you, perhaps, take this debugging of your home WiFi off to its own new thread, so that we don't overwhelm this one with SO MUCH off-topic stuff?  This thread is already too long with just the HBG3 development content.

 

Thanks


Edited by mlord, 09 December 2023 - 09:10 PM.


#944 Rac19

Rac19

    Soyuz

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

Posted 10 December 2023 - 05:08 AM

Telnet to Port 3000 is the configuration port for Celestron WiFi dongles, so that's what the HBG3 uses as well.

 

Once connected, hit enter once, then enter the debug command to gain access to the HBG3 commands (normally one only gets the Celestron commands).

 

But this is also totally unnecessary.   Instead, use the SkyPortal app on, say, a smartphone.  Connect the smartphone to the HomeBrew-xxxxx SSID, and then run SkyPortal and hit CONNECT, and so on.  Full instructions have been posted here a few times recently now:  https://www.cloudyni...6#entry13084984

I finally managed to telnet working, switching on debug and executing help and get all. The secret was to tell the telnet client to convert Cr to CrLf. I used a direct WiFi connection.

 

I think that the problem with connecting to my home network is that the distance/signal strength between the router and the telescope location is marginal. I think that connection occurs sporadically, enough to be assigned an IP address but not very consistently. There is a mesh repeater much closer to the telescope, but it is 5 Ghz only.



#945 mlord

mlord

    Cosmos

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

Posted 10 December 2023 - 08:10 AM

I finally managed to telnet working .. The secret was to tell the telnet client to convert Cr to CrLf.

That (CR/LF) is the default behaviour of standard telnet client software, INCLUDING the one built-into MS-Windows 10/11.  Client software that defaults otherwise is considered to be non-compliant with the Telnet specification:  https://www.rfc-editor.org/rfc/rfc854 :

 

         ".. the sequence "CR LF" must be treated as a single "newline" character and used whenever their combined action is intended;"


Edited by mlord, 10 December 2023 - 10:21 AM.


#946 Rac19

Rac19

    Soyuz

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

Posted 10 December 2023 - 02:23 PM

That (CR/LF) is the default behaviour of standard telnet client software, INCLUDING the one built-into MS-Windows 10/11.  Client software that defaults otherwise is considered to be non-compliant with the Telnet specification:  https://www.rfc-editor.org/rfc/rfc854 :

 

         ".. the sequence "CR LF" must be treated as a single "newline" character and used whenever their combined action is intended;"

I agree, I was surprised when I saw a checkbox to turn CrLf on. This was an iPad telnet client. When I tried to use the Windows CMD telnet client, Norton Security saw the HBG3 as a risk and refused to connect so I didn't get to test it.


Edited by Rac19, 10 December 2023 - 02:23 PM.

  • mlord likes this

#947 mlord

mlord

    Cosmos

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

Posted 10 December 2023 - 05:55 PM

There's a person out there with an HBG3, trying to use it with a Celestron Focus Motor in the setup.  Their claim is that the thumbstick is not working with the Focus motor, but the preset buttons do work.

 

So.. if this happens to you, this is how to work out where the issue might be:

  1. Try slewing the mount with the Nunchuck.  If this also fails, then get a new Nunchuck!!  :)
  2. Ensure one is looking through the eyepiece while focussing, because the slow range Left/Right of the thumbstick is VERY SLOW, for fine focussing.  Difficult to know if the motor is moving unless watching focus through the eyepiece.  The faster Up/Down range is probably better for testing functionality, because it moves the motor more quickly.
  3. If slewing with Nunchuck works, but focus with Nunchuck does not work, then ensure the Celestron Calibration sequence has been run on the Focus Motor.  Otherwise the default "focus limits" could be what is preventing direct movement with the Nunchuck.

Beyond that, not sure.  Feel free to add.



#948 Astro Andy

Astro Andy

    Explorer 1

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

Posted 10 December 2023 - 06:44 PM

Just to clarify that Mark 

 

Nunchuck control

* Pressing and holding both Nunchuck buttons simultaneously for 2 seconds will toggle between the slew+focus mode and a special focus-only mode with "Focus presets" using the buttons

* Holding in the "Z" button selects faster speeds while slewing

 

focus only mode:

* Holding the "C" button while in slew+focus mode selects the focuser

* Up/Down for coarse focus

* Left/Right for fine very focus

 

How are the buttons used for presets capture and recall?



#949 mlord

mlord

    Cosmos

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

Posted 10 December 2023 - 09:08 PM

Here is v8.25 of the firmware for this project: Attached File  hbg3.ino.v8.25.txt   268.93KB   32 downloads

  • Fix(?) Nunchuck to use appropriate speeds when talking to a Celestron Focus Motor vs a local stepper motor.

I am disappointed.  Very disappointed.

 

This has been broken for a very long time, and until today nobody bothered to point it out.  The way this stuff should happen, is I need you to try new firmware releases and tell me what doesn't work!!!  I'm just one guy, without Celestron's hardware inventory and other resources.  This needs your help to keep it better than what they offer!  flowerred.gif

 

EDIT:  To be re-visited when my own Celestron Focus Motor arrives this week.

 

Flashable binaries are in the usual places, including the OTA Firmware Update mechanism.

Off to Amazon now to purchase a Celestron Focus Motor that I'll never use myself, but needed for testing.

 

Blah.


Edited by mlord, 11 December 2023 - 10:55 AM.

  • fdboucher likes this

#950 mlord

mlord

    Cosmos

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

Posted 10 December 2023 - 09:34 PM

Just to clarify that Mark

Nunchuck control

The Nunchuck has two modes of operation:  Push-and-hold both buttons for a couple of seconds (BLUE LED will flash) to change between modes 1,2.  The current mode is saved in NVRAM and survives resets and power-cycles.

  1. Slew+Focus mode:  The thumbstick slews the mount by default.  Holding in the Z button while slewing gives a higher speed range.   Holding in the C button instead moves the Focus Motor, if present.
  2. Focus-only mode:  The thumbstick moves only the Focus Motor.  The buttons are used to remember and return Focus to "preset" or "saved" focus positions.  Push-and-hold a single button to memorize the current focus position (BLUE LED will flash).  Later, tap that button to cause the Focus Motor to return to the saved position.  Presets are saved in NVRAM, so they survive resets and power-cycles.

Whenever the thumbstick is controlling the Focus Motor, the Up/Down axis gives a higher variable speed range than the Left-Right axis.


Edited by mlord, 11 December 2023 - 09:33 AM.

  • Astro Andy and jmoflhrc like 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