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 Bluetooth accessory for Nexstar+ USB HC

  • Please log in to reply
65 replies to this topic

#26 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 14 February 2021 - 12:09 AM

Meanwhile, I'm done testing with this setup.  Because..  I accidentally fed +12V onto ... the USB interface inside my Nexstar+ hand-controller.  The controller works just fine otherwise, but it no longer works with a USB cable.  shocked.gif

It looks very likely to be just the USB-Serial chip that is damaged.

 

The PL2303SA USB-Serial chip still generates 3.3V power from USB, and the HC lights up when powered from USB.  So it partially works.  But it doesn't show up on the USB bus as a device.  So hopefully it is just that chip.  Easy enough to replace it.  Those are about $1/each from China, so I've ordered a pair for CAD$2 including postage.   I don't seem to have any devices on hand with one of those chips to cannibalize, so it'll have to wait 3-8 weeks for the replacement chips to arrive.

 

The HC continues to work just fine with the mount, so no problems for me other than being unable to do any more with this project for now.

 

And to repeat, it's not the Bluetooth project that killed it, but rather just me hooking up +12V to the 3.3V line of the ESP32 while the HC was connected to it.  Oooops!  :)



#27 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 14 February 2021 - 01:55 PM

Here is the latest code for the HomeBrew Bluetooth-HC adapter.  This was working quite well just before I accidently fried my HC due to a wiring mistake.  smile.gif

Attached File  usb_bt.ino.v0.4.txt   7.88KB   24 downloads



#28 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 14 February 2021 - 02:20 PM

And here are photos showing how to wire up this project.

 

There are four components:  the ESP32 module, the mini-USB host module, and a pair of LEDs.  There really ought to also be a 330-Ohm resistor in series with each of those LEDs, but I'm just running without them here in the prototype.

Attached Thumbnails

  • miniUSB_pins.jpg
  • miniUSB_bottom.jpg
  • miniUSB_side_view.jpg
  • esp32_side_view.jpg
  • esp32_connections.jpg

Edited by mlord, 14 February 2021 - 02:21 PM.


#29 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 15 February 2021 - 09:58 AM

I noticed a bug in the Arduino code, whereby it might send the same HC data multiple times over Bluetooth.  Never happened in real life, but it could.  So here's the fixed version, including more code clean-ups.  I was able to test this using a back-to-back pair of USB Serial adapters (to simulate the HC) in conjunction with Bluetooth, and it seems fine.

 

Attached File  usb_bt.ino.v0.5.txt   8.16KB   21 downloads


Edited by mlord, 15 February 2021 - 10:37 AM.

  • imrj and RoC1909 like this

#30 imrj

imrj

    Vostok 1

  • -----
  • Posts: 136
  • Joined: 19 Jan 2019

Posted 15 February 2021 - 12:26 PM



Because.. I accidentally fed +12V onto the 3.3V rail just now, and fried the USB-Serial chip on the ESP32, as well as the USB interface inside my Nexstar+ hand-controller. The controller works just fine otherwise, but it no longer works with a USB cable.

Cheers


Ah come on, that's a super easy fix for you... U just blew out the 3.3 VDO for the FTDI chip....no big deal, super simple fix, desoldr it and pop in a new one (an LG33 is likely to work fine, depending on input V/C)

I have lost count how many of those I've blown, bought a pack of 50 for like $15

Sent from my SHT-W09 using Tapatalk

#31 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 15 February 2021 - 02:44 PM

With the PL2303SA, the 3.3V regulator is on-chip.  So the only part to replace is the PL2303SA itself.



#32 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 15 February 2021 - 10:07 PM

An interesting tidbit about the mini-USB Host board featured in this project:  it was designed to solder directly to an Adruino Pro Mini (3.3V) board.  I do happen to have one of those laying around here looking for such a purpose.

 

So my eventual plan is to mate that with another mini-USB host board and get it working, using an HC-05 Bluetooth module soldered to the serial header of the Pro Mini.  This will likely happen after the replacement PL2303SA chips arrive so I can fix my HC and test things properly.

 

Cheers


Edited by mlord, 15 February 2021 - 10:07 PM.


#33 coollick

coollick

    Explorer 1

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

Posted 24 February 2021 - 04:54 PM

Hope you can fix your HC.

Another interesting one ... Still prefer the "Homebrew Wifi/Bluetooth accessory for AUX bus" but gotta wait for my much needed parts, in the FedEx truck arriving possibly tomorrow.

 

Well I stumbled upon that same USB host shield in my box ... of what my wife would call a whole lot of junk, well she needs to stay happy with all her crafting junk polluting my work space wink.gif

 

So I built this one, with an Esp32 and it works pretty well, same flaky initial connection.
However your steps to get it started don't work for me ... i always end up with the HC displaying "BOOT LOADER Serial CFM Request"

I have to turn on/reset the Esp32, then turn on the mount within about 1 second and hope for luck.

It seems I have to power on my mount immediately when I see these lines in the serial console, too fast or too slow and its a miss.

reset_usbhost
Reset complete.
Ready.

Seems the initial usb reset puts my mount into boot loader mode.

 

When I get more time, I will look at your code and let you know if I find anything I can fix or help with.

 

Cheers



#34 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 24 February 2021 - 05:48 PM

Boot loader mode is what CPWI wants to see.

Are you trying to get it to work with CPWI, or with something different?


Edited by mlord, 24 February 2021 - 08:31 PM.


#35 coollick

coollick

    Explorer 1

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

Posted 24 February 2021 - 09:28 PM

I used it with SkySafari and was able to control the mount but never tried CPWI, I will give it a shot. Maybe we could figure out switch to startup for CPWI or SkySafari.

#36 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 24 February 2021 - 09:44 PM

I used it with SkySafari and was able to control the mount but never tried CPWI, I will give it a shot. Maybe we could figure out switch to startup for CPWI or SkySafari.

There's a way to auto-detect it, but that was "having issues" while I was working on it, so I just added code to force it.  And then I killed the USB on my HC, so I haven't been able to go back and address it properly since then.

 

If you want to try it with the original smarts, then just disable/remove this code from within the manage_usb_state() function:

 

      uint8_t data = 0x8a;
      uint8_t ret = hc.SndData(1, &data);
      delay(50);  // give time for the 0x8a to be sent
      want_baud_change = get_timeout(500);

 


Edited by mlord, 24 February 2021 - 09:45 PM.


#37 coollick

coollick

    Explorer 1

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

Posted 25 February 2021 - 11:30 AM

Yes that did it for SkySafari, as long as the mount is powered on first, then Esp32 or a reset.



#38 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 25 February 2021 - 01:05 PM

Mmm.. Esp32 state shouldn't really matter if that code fragment above is disabled/removed.  But.. okay.  I'll get back to this project again once I get a working HC.  With luck the PL2303SA chip might arrive in a week or two.

 

Cheers



#39 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 08 March 2021 - 07:37 PM

It looks very likely to be just the USB-Serial chip that is damaged.

..

And to repeat, it's not the Bluetooth project that killed it, but rather just me hooking up +12V to the 3.3V line of the ESP32 while the HC was connected to it.  Oooops!  smile.gif

Replacement PL2303SA chips arrived in the post today.  I bought spares in case they're needed again in the future, given how cheap they are but with a long lead time for acquisition from Asia.

 

1_oldchip.jpg

2_removed.jpg

3_replaced.jpg

 

The HC is now fully functional again over USB.  Yay!

 

PS: Is it just me, or does that black screw mount at lower right look like an eyeball??


Edited by mlord, 08 March 2021 - 07:40 PM.

  • Chote, Acapulco Rolf and blp042 like this

#40 imrj

imrj

    Vostok 1

  • -----
  • Posts: 136
  • Joined: 19 Jan 2019

Posted 08 March 2021 - 08:53 PM

Awesome, like new!

Sent from my SM-G988U using Tapatalk

#41 imrj

imrj

    Vostok 1

  • -----
  • Posts: 136
  • Joined: 19 Jan 2019

Posted 08 March 2021 - 09:00 PM

Interesting how for the HC they used an STM32 but for the wifi it's an NXP....
I took my mount apart today to replace the broken Rj12 aux connector and took lot of pics., will post later on, I suspect someone has already,
but nothing too interesting, mostly flash memory and cross connections, didn't see any brains in there, no processor, so likely the mount just runs the motors and acts as a hub, i believe everything command wise happens on wifi unit or HC... I say or because I can operate scope via Cpwi w/o handset attached

Sent from my SM-G988U using Tapatalk

#42 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 08 March 2021 - 09:10 PM

Yes, the mount just houses the motor drivers and a motor controller (MC) for each motor.  And sometimes a GPS receiver, and sometimes a WiFi transceiver.  The MCs are PICs in the photos I have seen.

 

All of which are bus targets, only ever responding and never issuing commands themselves.  The smarts are in the initiators (bus "masters"), which include the various hand-controllers, and software on a "smart device" (phone, tablet, notebook) connected to the mount via any of several options including WiFi.


Edited by mlord, 08 March 2021 - 09:11 PM.

  • imrj likes this

#43 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 09 March 2021 - 07:36 AM

My Nexstar+ HC is fixed now, but I am still waiting for SkySafari-7 to appear before resuming this project.  And.. Amazon.ca just had a 10% price drop on the StarSense accessory, so I snagged one of those for here (arriving tomorrow).  This means I should be able to test the Bluetooth/USB adapter with the StarSense HC as well.  Happy Days!



#44 imrj

imrj

    Vostok 1

  • -----
  • Posts: 136
  • Joined: 19 Jan 2019

Posted 09 March 2021 - 07:42 AM

I am part of the beta program for SS, development team has announced a beta release by end march

Sent from my SM-G988U using Tapatalk
  • blp042 likes this

#45 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 29 March 2021 - 01:12 PM

A note about this project:  I am still expecting to see SkySafari-7 released at some point in the next couple of weeks, at which point I will purchase a copy and resume efforts on this project.

 

A note I spotted on the SkySafari site/forums:  "If you are using SkyFi 3 then the StarSense alignment process must be initiated and completed using Celestron's StarSense hand controller.  Then you can connect with SkySafari 6 Plus/Pro."

 

I expect that our project here will appear to SkySafari the same as a "SkyFi 3" through the bottom of the handset.   So the same procedure ought to apply to us here.

 

Meanwhile, once we do get the USB from HC working over Bluetooth here, I expect that this project will get merged into the main WiFi+BT+GPS project.

 

Cheers


  • coollick likes this

#46 imrj

imrj

    Vostok 1

  • -----
  • Posts: 136
  • Joined: 19 Jan 2019

Posted 06 April 2021 - 11:56 AM

Don't get your hopes up for SS7.... Delayed.... Their latest update below

"We hired 2 new developers.
SS7 is coming soon.  Still no firm ETA.  But 2021 most likely."


Sent from my SM-G988U using Tapatalk

#47 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 13 April 2021 - 11:17 AM

Yes that did it for SkySafari, as long as the mount is powered on first, then Esp32 or a reset.

I have ordered a very cheap 8" Android tablet for delivery here today.  I'll try it out with SkyPortal over WiFi to begin with, and if I like it enough I may just end up paying for SkySafari-6+ and then get this Bluetooth project rolling again.

 

I think we'll ignore CPWI for the moment, or perhaps take your excellent suggestion of a "mode switch" for it.   But I'll prioritize SkySafari, because I don't actually use CPWI, and lack a full-time MS-Win box for that anyway. :)

 

Really REALLY curious here as to how much better Bluetooth is over WiFi.  Everything says it should be excellent, but we'll see.  Longer term, I'd like to have a go at Bluetooth Low Energy (BLE) as well -- the existing hardware can do it, so no change there.  Just the software (firmware) for it is a lot more complex than the simple SPP (Serial Port Profile) that it currently uses.

 

Cheers


Edited by mlord, 13 April 2021 - 11:18 AM.


#48 jasonjeremiah

jasonjeremiah

    Viking 1

  • *****
  • Posts: 684
  • Joined: 28 Nov 2009
  • Loc: Hanahan SC

Posted 13 April 2021 - 01:41 PM

I finally got a chance to thoroughly try out the HB BT/Wifi adapter last night and it worked flawlessly.  Alignment through SkyPortal was a disaster, but the adapter itself worked great.  I started to attempt alignment with SkySafari but it was late already and I had to be in early this morning.  I swear SP and SS look like the same piece of software, though SS does seem to have a few more options in settings.  I really can't fathom how BT would operate better than Wifi.  Once connected, I have no dropping issues like BT is notorious for.  I have never gotten BT to work through SS or SP but really haven't tried that diligently as Wifi works so well.  I popped into this thread because I'm now the proud owner of a nearly new (6 months old) Nexstar 8SE that I bought for $600 and it came with the Nexstar+ with USB port (**** I've got to stop buying telescopes!).  Figured I'd give this project a whirl since I have some spare ESP32s laying around.

 

*side note - guess I need to come up with some craftier hidden swear words as the software keeps bleeping out the classics!


Edited by jasonjeremiah, 13 April 2021 - 01:42 PM.


#49 mlord

mlord

    Soyuz

  • *****
  • topic starter
  • Posts: 3,848
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 13 April 2021 - 01:55 PM

Congrats on the great deal for that 8se!  There'll be a few of those around by end of the summer I expect!

 

Tablet just arrived here.  Will play with it later today.



#50 coollick

coollick

    Explorer 1

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

Posted 13 April 2021 - 02:19 PM

I've got a fair amount of GooglePlay credits from all the opinion reward surveys ... If only there was a way to transfer those credits or purchase the app for you as a gift, I would.

Or maybe add you to my family, like my son & wife can install the app for free because I have already purchased it.

 

The only advantage when using Bluetooth is the ability to use your mobile internet connection.

You loose your mobile internet connection when the phone is connected to an access point that does not provide internet.

A way around this is to use client mode and have it connect to your phone's hotspot.




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