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 Wifi/Bluetooth accessory for AUX bus

  • Please log in to reply
668 replies to this topic

#626 jasonjeremiah

jasonjeremiah

    Mariner 2

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

Posted 07 May 2021 - 01:34 PM

SkyPortal and SkySafari are the same software, just with different price tags and different features enabled/disabled by the maker.

 

CPWI is a completely different software from different people.  So the two do things slightly differently from one another.  No surprise.

 

Another such difference, is that when doing a StarSense AutoAlign, CPWI on my mount goes counterclockwise (N,W,S,E) whereas the other two go clockwise (N,E,S,W).

 

I'll reboot into my temporary MS-Win environment and see what CPWI does here -- whether or not it issues that same command against the Evolution mount, and if so then what the mount responds with.

OK, thanks!  I'm going to try to do some imaging tonight.  The GPS mount is such a better mount than the SE, except for the inability to use newer accessories like the StarSense.  I'd still take it everyday and twice on Sunday over the SE or many of the other Goto mounts.  The motors, gears, slewing and lack of backlash are so much better.  Of course, it weighs a ton but I'm lucky to still be healthy enough to heft it up onto a wedge.  The SE mount just seems like a toy after using the GPS mount.



#627 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 07 May 2021 - 01:40 PM

I'll reboot into my temporary MS-Win environment and see what CPWI does here -- whether or not it issues that same command against the Evolution mount, and if so then what the mount responds with.

Okay, on my Evolution mount, CPWI also issues that same command 23 MC_GET_MAX_RATE.

 

But the response from the Evolution mount includes an extra byte of response data (00):

000420089 auxbus_tx: 3b 03 20 10 23 aa

000420094 auxbus_rx: 3b 04 10 20 23 00 a9

 

So CPWI must be expecting a response of that length, and ignoring anything else.  The same as it does for the MC_GET_MODEL command that we discovered earlier.

 

Easy enough to take care of that here too, though.  See later posts..


Edited by mlord, 07 May 2021 - 02:08 PM.


#628 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 07 May 2021 - 01:55 PM

After MC_GET_MAX_RATE(23), CPWI then does MC_GET_MAX_SLEW_RATE(21):

 

000420089 auxbus_tx: 3b 03 20 10 23 aa  ## MC_GET_MAX_RATE

000420094 auxbus_rx: 3b 04 10 20 23 00 a9

 

000420140 auxbus_tx: 3b 03 20 10 21 ac  ## MC_GET_MAX_SLEW_RATE

000420146 auxbus_rx: 3b 07 10 20 21 0f a0 11 94 54

 

This is then followed by MC_POLL_CORDWRAP and MC_GET_CORDWRAP_POS:

 

000420183 auxbus_tx: 3b 04 20 10 3b 01 90  ## MC_POLL_CORDWRAP

000420189 auxbus_rx: 3b 05 10 20 3b 00 90 00

000420233 auxbus_tx: 3b 03 20 10 3c 91 ## MC_GET_CORDWRAP_POS

000420239 auxbus_rx: 3b 06 10 20 3c 00 00 00 8e

 

Next it wants MC_GET_NEG_BACKLASH from both motors:

 

000420277 auxbus_tx: 3b 03 20 10 41 8c

000420281 auxbus_rx: 3b 04 10 20 41 3c 4f

000420329 auxbus_tx: 3b 03 20 11 41 8b

000420334 auxbus_rx: 3b 04 11 20 41 0a 80

 

Then it likewise continues with MC_GET_APPROACH:

 

000420370 auxbus_tx: 3b 03 20 10 fc d1

000420375 auxbus_rx: 3b 04 10 20 fc 00 d0

000420417 auxbus_tx: 3b 03 20 11 fc d0

000420422 auxbus_rx: 3b 04 11 20 fc 00 cf

 

And then MC_GET_POSITION:

 

000420464 auxbus_tx: 3b 03 20 10 01 cc

000420470 auxbus_rx: 3b 06 10 20 01 ff ff ff cc

000420511 auxbus_tx: 3b 03 20 11 01 cb

000420517 auxbus_rx: 3b 06 11 20 01 ff ff ff cb

 

After all of that, it then unsuccessfully does MC_GET_FW_VER for the SS Camera:

 

000420745 auxbus_tx: 3b 03 20 b4 fe 2b

(no response from the camera; this gets retried a few times, still no response)

 

And proceeds from there querying various other peripherals on the mount: Charge controller, etc..

 

Most of the above can be emulated if need be to keep things moving along, but first let's see what it does next on the NexstarGPS mount. 


Edited by mlord, 07 May 2021 - 01:57 PM.


#629 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 07 May 2021 - 02:07 PM

Looking back at the venerable NexStar_AUX_Commands_10.pdf document, it looks likely that the NextstarGPS probably won't respond correctly to the MC_GET_MAX_SLEW_RATE command either.

 

So just in case, use this version instead, which will look for that and substitute the response from my Evolution mount, only if the NexstarGPS responds with no data as before:

 

(superseded by newer code below)

 


Edited by mlord, 07 May 2021 - 07:28 PM.


#630 jasonjeremiah

jasonjeremiah

    Mariner 2

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

Posted 07 May 2021 - 03:35 PM

Looking back at the venerable NexStar_AUX_Commands_10.pdf document, it looks likely that the NextstarGPS probably won't respond correctly to the MC_GET_MAX_SLEW_RATE command either.

 

So just in case, use this version instead, which will look for that and substitute the response from my Evolution mount, only if the NexstarGPS responds with no data as before:

 

attachicon.gifesp32_wifi.ino.txt

This was the resulting output after uploading the new code.  Difference with CPWI, was it did NOT continue with the "Connecting" message like it normally does, but said "searching" and then "Unable to communicate with the mount.  Please verify that the computer is connected to the network..."

 

UPDATE:  Still had the other HB plugged into one of the other AUX ports so it screwed with the serial output.  Re-connected with only the one HB adapter w/ new code plugged in.  I've attached the resulting output as a text file as it's rather long for a post.  Same message though from CPWI.

Attached Files


Edited by jasonjeremiah, 07 May 2021 - 03:42 PM.


#631 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 07 May 2021 - 03:39 PM

Reset it and try again.  Something else was wrong at that attempt.

 

I suppose it is possible that I have simply broken something (elsewhere) in that sketch -- haven't tested it here in a while, and I have been backporting some new fixes from the allinone project..


Edited by mlord, 07 May 2021 - 03:40 PM.


#632 jasonjeremiah

jasonjeremiah

    Mariner 2

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

Posted 07 May 2021 - 03:42 PM

Reset it and try again.  Something else was wrong at that attempt.

 

I suppose it is possible that I have simply broken something (elsewhere) in that sketch -- haven't tested it here in a while, and I have been backporting some new fixes from the allinone project..

Updated output.  Still had another HB plugged into the AUX port on the arm of the scope.



#633 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 07 May 2021 - 07:28 PM

That's much better.  It is getting beyond the MC_GET_MAX_RATE command now, but stuck on the anticipated MC_GET_MAX_SLEW_RATE follow-up, due to a bug in the (new) code.

 

Fixed.

Attached File  esp32_wifi.ino.txt   40.98KB   6 downloads



#634 jasonjeremiah

jasonjeremiah

    Mariner 2

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

Posted 08 May 2021 - 06:24 PM

That's much better.  It is getting beyond the MC_GET_MAX_RATE command now, but stuck on the anticipated MC_GET_MAX_SLEW_RATE follow-up, due to a bug in the (new) code.

 

Fixed.

attachicon.gifesp32_wifi.ino.txt

That worked.  Connected in less than 5 seconds.  Haven't had the chance to test yet other than just slewing.  It initially searched for StarSense, because the last time I ran CPWI, I was using a Nexstar SE with SS plugged in.  I restarted the Nexstar GPS and re-connected with the SS plugged in, but it never found it.  It did not prevent it from wirelessly connecting, though.  With SkyPortal and SkySafari, they won't even connect wirelessly if the StarSense is plugged into  one of the AUX ports.  Here's some of the verbose in case you wanted to see it.  BTW

 

I had one of the best nights viewing/imaging last night I've had in a while.  Used SkyPortal with the HB adapter and my Nexstar 8 GPS.  Aligned on 4 stars in around 10 minutes and did ASPA and only had to make a minor alt adjustment and was within less than a degree of polar alignment.  Took 100 60 second explosures of the Whirlpool Galaxy with no star trails.  Don't think that would have been possible with the Nexstar 8 SE.  Going to try for the Sombrero Galaxy tonight.  Thanks for your help on the adapter!

Attached Files


Edited by jasonjeremiah, 08 May 2021 - 06:25 PM.

  • mlord likes this

#635 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 08 May 2021 - 08:11 PM

With SkyPortal and SkySafari, they won't even connect wirelessly if the StarSense is plugged into  one of the AUX ports.  Here's some of the verbose in case you wanted to see it.

So.. what exactly was running when you captured that NXGPS_CPWI.txt trace ??  It looks like two things were trying to talk at the same time, but hard to say for sure.



#636 jasonjeremiah

jasonjeremiah

    Mariner 2

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

Posted 08 May 2021 - 09:38 PM

Starsense camera.

#637 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 08 May 2021 - 09:51 PM

What software were you connecting with during the capture of NXGPS_CPWI.txt ?



#638 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 08 May 2021 - 09:57 PM

Version 3.7 of the ESP32 code for the HomeBrew WiFi/Bluetooth/GPS accessory is now on the project site at http://rtr.ca/esp32_wifi+bt+gps/

 

This version includes the recent workarounds for the NexstarGPS mount, and also a change in how the code deals with echoed-back packets on the aux bus.

 

Previously, it would attempt to simply flush() the Serial receive buffer immediately after sending a packet, which works for modern mounts.  But the NexstarGPS mount (and probably other vintage mounts) buffers the entire message and then echos it back from firmware, and most of the  echo-back then arrives too late for the simple Serial.flush() to deal with it.

 

So instead, the code now captures the echoed-back packet, compares it with what was sent, and discards it when the two match.  Much better.  Some day, we might even consider retransmitting garbled echo-backs, but currently the code relies upon the applications to do that instead.

 

Cheers


Edited by mlord, 08 May 2021 - 10:00 PM.


#639 jasonjeremiah

jasonjeremiah

    Mariner 2

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

Posted 09 May 2021 - 12:11 AM

What software were you connecting with during the capture of NXGPS_CPWI.txt ?

Not sure what you mean?  I made a wireless connection from my laptop, that was already directly connected to the HB's wifi to CPWI.  This was only one portion of the verbose.  I recorded about three.  But the initial connection attempt and success, was followed by a 10 second or so search by CPWI for the StarSense camera, which was not plugged in at the time.  I then powered off and plugged in the Starsense camera.  It didn't prevent CPWI from connecting, but CPWI was never successful in seeing the StarSense camera.  I'm resigned to the likely fact that I may never get StarSense to work with the Nexstar GPS, which is unfortunate since it is the mount I use most often.  But now that SkyPortal/SkySafari seem to be working wirelessly, not that big of a deal to do manual 4 star alignments and adding in reference points.  


Edited by jasonjeremiah, 09 May 2021 - 01:24 AM.


#640 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 09 May 2021 - 12:13 AM

The question is pretty simple:  You posted a log file called NXGPS_CPWI.txt in the context of discussing SkyPortal and SkySafari.

 

So I simply wanted to know which software was actually used when that log file was captured:  CPWI, or SkySafari, or SkyPortal?

 

But I've lost interest in that now.



#641 jasonjeremiah

jasonjeremiah

    Mariner 2

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

Posted 09 May 2021 - 01:22 AM

The question is pretty simple:  You posted a log file called NXGPS_CPWI.txt in the context of discussing SkyPortal and SkySafari.

 

So I simply wanted to know which software was actually used when that log file was captured:  CPWI, or SkySafari, or SkyPortal?

 

But I've lost interest in that now.

CPWI - that's why the file is labelled NXGPS_CPWI.  If it was a capture of connection with SkySafari or SkyPortal I would have labelled it as such.


Edited by jasonjeremiah, 09 May 2021 - 01:25 AM.


#642 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 09 May 2021 - 10:01 AM

Thanks.  I do think it's pretty cool that you got CPWI talking to the mount again over WiFi.  The latest v3.7 of the ESP32 code may improve things further, or not.  Bit of guesswork at this point as to what's up with the StarSense Camera -- perhaps it suffers from the same issue with the delayed echo-back of commands on that mount.  Recall that more modern mounts now just hardwire RX to TX so that echo-back is instantaneous, whereas that NXGPS mount does it after the fact in firmware.


Edited by mlord, 09 May 2021 - 10:02 AM.


#643 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 09 May 2021 - 10:08 AM

A further thought about the SS camera with CPWI:  The camera does seem to take a long time, perhaps 30-45 seconds, to "come to life" after the mount is powered on.  So perhaps ensure that you wait at least that long before starting the connection from CPWI.



#644 jasonjeremiah

jasonjeremiah

    Mariner 2

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

Posted 09 May 2021 - 01:06 PM

A further thought about the SS camera with CPWI:  The camera does seem to take a long time, perhaps 30-45 seconds, to "come to life" after the mount is powered on.  So perhaps ensure that you wait at least that long before starting the connection from CPWI.

I could try.  I think what I will try is just plugging in the Starsense alone and connecting the AUX bus scanner to see if it "sees" anything.  I've got the AUX bus scanner loaded onto a laptop but the last time I attempted running it, it gave me a conmode error but was busy working on a few other things so didn't research it.

 

I can tell you, if I plug in the StarSense camera and then plug in the StarSense hand control to the Nexstar GPS mount, after the HC initializes it displays a "Waiting for Camera" message that does NOT go away.  I've let it sit for hours and it's still "Waiting for Camera."



#645 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 09 May 2021 - 01:19 PM

if I plug in the StarSense camera and then plug in the StarSense hand control to the Nexstar GPS mount, after the HC initializes it displays a "Waiting for Camera" message that does NOT go away.  I've let it sit for hours and it's still "Waiting for Camera."

Does that HC work by itself in that mount, with no camera plugged in?

I think you have to hit the ALIGN button or something on it to break it out of the initial stupor.  :)
 



#646 jasonjeremiah

jasonjeremiah

    Mariner 2

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

Posted 09 May 2021 - 01:26 PM

Does that HC work by itself in that mount, with no camera plugged in?

I think you have to hit the ALIGN button or something on it to break it out of the initial stupor.  smile.gif
 

Yeah, the HC works fine on it's own with the NXGPS.  If I use the SS camera and HC with the Nexstar SE mount, it gives the same "Initializing Packages" and "Waiting for Camera" message but then moves on to the New Telescope or Select Profile dialog after 30 seconds or so.



#647 Chote

Chote

    Messenger

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

Posted 14 May 2021 - 08:48 PM

After waiting for a month from eBay for the 6p6c female piece, soldering it up with ESP32 female pins. Put it in a temporary box for testing.

Attached Thumbnails

  • homebrew_wifi.jpg

  • mlord likes this

#648 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 14 May 2021 - 09:18 PM

That looks pretty slick!  Your earlier close-up photos made it all look so much larger than it really is.  Nice!


  • Chote likes this

#649 mlord

mlord

    Surveyor 1

  • *****
  • topic starter
  • Posts: 1,508
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 14 May 2021 - 09:56 PM

.. I'd very much prefer to use bluetooth, so that the smartphone  1) can stay internet connected where feasible, and 2) will stop complaining that the Telescope doesn't provide internet connectivity!   Skyportal doesn't do bluetooth, but SkySafari apparently does.  There's also an Android app out there which can be used to redirect bluetooth to make it appear to be coming from an IP address (eg. wifi) instead -- if that works, then this would enable a bluetooth connection to work with SkyPortal!  Yay!

 

For easy reference, here's a link to the (paid, but cheap) BT/USB/TCP Bridge Pro app for bridging connections on Android:

https://play.google....ge.pro&hl=en_US

Revisiting the original plan (above).. I got this working here today finally:

https://www.cloudyni...5#entry11101542


  • Chote likes this

#650 Chote

Chote

    Messenger

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

Posted 14 May 2021 - 10:07 PM

That's great news. So you are saying if I have this project completed, and have such bridge app running, I can use bluetooth connection for Skysafari too.. I no longer need the https://www.cloudyni...b-hc/ "Homebrew




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