The idea to reinforce the USB connector.of ESP32 (by mlord; post #1020) is not bad. It is quite easy to break away USB socket from the board when the cable is connected or disconnected many times for upload. Anyway, we need to be careful.

Homebrew Wifi/Bluetooth accessory for AUX bus
#1226
Posted 23 November 2022 - 06:58 AM
#1227
Posted 23 November 2022 - 07:36 AM
Some of the ESP32 boards out there use through-hole soldered connectors, which are much stronger. But it does seem luck of the draw which kind one gets!
#1228
Posted 23 November 2022 - 04:49 PM
Lately I've spent a LOT of time and effort working to get the pull-up resistor values "just right" in this and other projects, so that they work well on a variety of mounts. Along the way, I'm becoming convinced that Celestron themselves use active driving for both HIGH and LOW on the bus, which seems to be the only way to have things be compatible out-of-the-box with all of their various product designs.
The jdlucas All-In-One PCB has wiring/jumper options for "Source/Sink" active drive on the AUX bus, with in-line current-limiting resistors to prevent damage. So today, I decided to have a go at doing it for this simpler WiFi+Bluetooth project. Here is the result of the very first attempt. Click on the photo for a larger/clearer view:
This actually worked first try for me here! Yay!
On the breadboard, Yellow is the RX path, Green is the TX path, Blue is BUSY-OUT, and White is BUSY-IN. There is one 1N4007 diode, and eight resistors: two 5K, two 10K, two 470-ohm, one 100K, and one 1M. Plus a 5V-output miniature buck converter. It is two columns too wide to fit onto a single half-breadboard, so a pair of them were used. Though it could be squeezed onto one by placing four of the resistors under the ESP32 module.
No ESP32 code or pin changes, other than ensuring the Arduino sketch was set for two BUSY pins rather than a single in/out pin. This uses the 74HCT125 chip, driven at +5V, and two pairs of resistors to step that down to 3.3V on the RX and BUSY-IN signals to the ESP32 chip.
I have avoided this design in the past, because it adds quite a few extra resistors of various values to the build. But if one has a variety of telescope mounts, and needs the same accessory to work on anything as it is moved between them, then this could be the way to go.
Thus far, it has only been tested on my Evolution mount, where everything always works and the sky is dark and clear! But because of the fully active drive on the TX and BUSY-OUT signals, I have very high hopes that it will also work on pretty much anything else from Celestron. Time will tell.
I'll draw it up and post the wiring diagram here at some point.
I just wish it were simpler. I may actually try and produce a PCB for it at some point, unless anyone else wants to beat me to it (please?)!
Cheers
Edited by mlord, 23 November 2022 - 09:17 PM.
#1229
Posted 23 November 2022 - 08:38 PM
Hey Mark,
While waiting on my meetup with a person to lend me a hand controller, I rebuilt the whole thing in a better package and used the updated 100k to 3v3 and 75k to 5v. As you can see I had to make some series resistors (6.8k+68k) to hit 75k. However, now I get nothing back at all after sending t in the serial monitor. Just the tx message. Before I at least got the first echo. Could you just have a look at the wiring? Thanks.
#1230
Posted 23 November 2022 - 09:03 PM
The latest code no longer shows that first echo -- I've removed echo-back from the sketch, as CPWI sometimes is not happy with it.
As near as I can see from the photos, the second diode is missing -- the one that is supposed to go between +12V from the mount and the rest of the circuit here. This prevents any PC connected over USB from trying to power the mount and accessories, possibly losing Magic Smoke in the process.
I haven't spotted any wiring errors, but it's tricky to follow despite the good photographs. I don't recall what mount this is for.
#1231
Posted 23 November 2022 - 09:13 PM
The latest code no longer shows that first echo -- I've removed echo-back from the sketch, as CPWI sometimes is not happy with it.
As near as I can see from the photos, the second diode is missing -- the one that is supposed to go between +12V from the mount and the rest of the circuit here. This prevents any PC connected over USB from trying to power the mount and accessories, possibly losing Magic Smoke in the process.
I haven't spotted any wiring errors, but it's tricky to follow despite the good photographs. I don't recall what mount this is for.
Thanks for the review Mark, appreciate it. The diode is actually in the heat shrink between the jacket and entry to the board - sorry I should've mentioned that. My mount is a 130SLT.
#1232
Posted 24 November 2022 - 04:41 AM
In my case (SLT mount) the circuit (mlord project v.4.5) works with two 51k as well as with two 100k. resistors on the HV side. Soldered set works without any problems - all errors earlier due to my wrong wireing or lost connections on breadboard (and also bad contact in AUX socket).
Remeber please - just in case - Access Point mode goes on 2,4 GHz only and not with 5GHz.
#1233
Posted 24 November 2022 - 08:53 AM
My mount is a 130SLT.
Okay, as bjs53 says, 51K on the HV side works on his SLT mount. Try that?
#1234
Posted 25 November 2022 - 10:19 PM
... "Source/Sink" active drive on the AUX bus, with in-line current-limiting resistors to prevent damage. So today, I decided to have a go at doing it for this simpler WiFi+Bluetooth project.
And here it is again, with a newly-assembled soldered build next to the somewhat less compact breadboard version of the same circuit:
So it is still possible to package it as compactly as earlier designs, but it did take a bit of effort to accomplish that. Here are all of the parts, which were packed onto the underside of the (pin-less) ESP32 module:
Edited by mlord, 25 November 2022 - 10:28 PM.
#1235
Posted 26 November 2022 - 12:42 PM
That is quite a miniaturization! And no “Magic smoke”!
I am grateful, and my Nexstar is happy too!
It looks like the clouds are going to hang around quite a long time now,
Paul
#1236
Posted 27 November 2022 - 09:25 AM
Well, a good night out at my first ever Star Party last evening!
One of the other chaps there had an AVX mount, so I got to try a couple of HomeBrew devices on it.
- The HomeBrew WiFi with active Source/Sink interfacing worked perfectly!
- The HomeBrew GPS did not work -- wrong resistor value for that mount, it seems.
- The voltage regulator on the Pro Micro board of the AuxRelay prototype went up in smoke.
The "up in smoke" was likely due to higher-than-12V from the AUX bus. So we'll add another diode or two in series with the +12V from the mount, to drop the input by another volt or two, providing some headroom there.
I'm also going to redo all of the 5V Pro Micro designs to use active interfacing rather than relying upon random pull-up resistors. This is something which the GPS project has already used in the past, and it's time to bring it back. This should be trivial -- just 470-ohm series resistors on TXO and BUSY, along with code changes to tri-state those pins when not active. No more random pull-ups.
The active interfacing using a 74HCT125 chip for the 3.3V ESP32 is going to need a custom printed circuit board to be viable -- it's just too many parts to string together the way it is, but it does now seem to be the way forward. No more resistor fussing. I envision perhaps a tiny daughter board just for the AUX bus interface, which can then be used with various chips including the ESP32 and the BW16 (RTLduino), and also with ProMicro boards. Or even with a RaspberryPi for those who like really slow start-up times.
This ought to keep me busy enough!
#1237
Posted 27 November 2022 - 11:53 PM
OK, so I bought myself a Christmas present, a CGEM II mount, which beats completely the socks my wife will be buying me.
It's used, and it's sight unseen, and I bought it from a store I've never dealt with before, but I'm excited anyway.
The mount hasn't arrived yet, but while it's on the way, I thought I would build myself an All-In-One, as described here. I have some ESP32s around, a couple of GPS units, some 74HC125s and a fair bit of experience with ESP8266s and the Arduinos IDE. So I figured this wouldn't be too hard. (Famous last words)
I haven't wired anything up yet, I just wanted to make sure the code compiles.
So fired up the IDE, downloaded the newest code, installed the latest version of the ESP32 boards, and picked a LOLIN D32 Lite as the board. And as I want an almost All-In-One (i.e., I don't want ethernet), I left that #define set to false but DID set Bluetooth to true and also set GPS to true.
I hit compile, waited, and was greeted with a message (copied below) that the sketch was too big!
Huh?
This doesn't seem like that big a sketch.
Plus, I thought this part had 4 MB of code space .. the data sheet certainly says so .. but the error message seems to suggest that the IDE thinks it only has 1. I tried a number of other boards and got the same message.
Am I missing something here?
Or try this another way, if you do have a working setup, what board did you select?
Thanks for any thoughts.
Alan
Arduino: 1.8.13 (Windows 10), TD: 1.56, Board: "WEMOS LOLIN32 Lite, 80MHz, Default, 240MHz (WiFi/BT), 921600, None, Disabled"
Sketch uses 1452749 bytes (110%) of program storage space. Maximum is 1310720 bytes.text section exceeds available space in board
Global variables use 52516 bytes (16%) of dynamic memory, leaving 275164 bytes for local variables. Maximum is 327680 bytes.
Sketch too big; see http://www.arduino.c...leshooting#size for tips on reducing it.
Error compiling for board WEMOS LOLIN32 Lite.
#1238
Posted 28 November 2022 - 02:16 AM
.. I thought I would build myself an All-In-One, as described here.
I hit compile, waited, and was greeted with a message (copied below) that the sketch was too big!
Wrong thread. The All-In-One discussion goes here: https://www.cloudyni...netgpsjoystick/
However, the same answer would also apply to the WiFi+BT project. Both projects have this in the main source code file, very near to the top:
* Arduino IDE configuration for this project:
* -- First, select Board="ESP32 Dev Module".
* -- Now choose Partition Scheme="Huge APP (3MB..)".
* -- and also CPU Frequency = 160Mhz or 240Mhz (WiFi/BT).
I recommend against building the All-In-One. It is very complex, and leaving parts out can have side-effects that I'd rather not spend time debugging. The WiFi+BT+GPS project is much easier, and is about to get even simpler: I am now having PCBs made for the new "active drive" version that I have been trialling here. Those will be available, bare or assembled, in a couple of weeks.
#1239
Posted 28 November 2022 - 08:58 AM
I am now having PCBs made for the new "active drive" version that I have been trialling here. Those will be available, bare or assembled, in a couple of weeks.
This should do for a first attempt. I opted for an unpopulated 2-sided PCB using through-hole components. At some point in the future, I might do just the AUX port interface by itself using SMDs, and have the factory actually populate them too -- curious what that would cost, as it appears to be modest. Speaking of which, I considered laying out a custom DC-to-DC 5V power converter on the board, but it is much cheaper to just use the pre-built 3-pin mini ones from AliExpress!
This ESP32 WiFi+BT+GPS board is small enough that it can be "packaged" with 50mm "flat" heat-shrink tubing and then just dangled from an AUX port -- no case required, no mounting required, no cord-wrap potential. There's a header for an optional GPS receiver, too.
I did forget to include the WiFi mode switch , but that is easily wired on and hot-melt glued in place for those who need it. Without it, the design defaults to "Direct Connect" mode.
Edited by mlord, 28 November 2022 - 09:50 AM.
#1241
Posted 28 November 2022 - 12:52 PM
Wrong thread. The All-In-One discussion goes here: https://www.cloudyni...netgpsjoystick/
First, thanks for the speedy reply! And thanks for doing this at all!
My bad here, on the incorrect terminology. It IS the BT+WIFI+GPS that I'm interested in, but I've been reading so many threads on this and other projects that I've lost track a wee bit.
#1242
Posted 28 November 2022 - 12:57 PM
However, the same answer would also apply to the WiFi+BT project. Both projects have this in the main source code file, very near to the top:
* Arduino IDE configuration for this project:
* -- First, select Board="ESP32 Dev Module".
* -- Now choose Partition Scheme="Huge APP (3MB..)".
* -- and also CPU Frequency = 160Mhz or 240Mhz (WiFi/BT).
Another bad on my part, in that I somehow missed these instructions. Following them, it compiled correctly.
However, I'm not sure what .. exactly .. an "ESP32 Dev Module" actually is. Are all these modules out of China more or less the same? That is, if my LOLIN modules have 4MB of flash on them, can I likely expect them to work?
#1243
Posted 28 November 2022 - 01:07 PM
And for anyone brave enough to wire this up without a PCB, here's the schematic (without the mode switch):
The missing "mode switch" gets connected between ESP32 Pin-D5 and GND. When "on", "Access Point" mode is selected.
There seems to be a new wrinkle in this schematic (or more likely, I haven't been paying attention).
You now specify an HCT device, and run it off 5 volts, then use resistors to level shift it down to 3.3 volts.
Is this to give 5 volts of output drive to the mount?
And another question; all the versions I've seen have a serial transmit line going to the GPS. Is this ever actually used? After my NEO modules are configured on a PC, I consider them to be three terminal devices ...
#1244
Posted 28 November 2022 - 01:09 PM
The module will be a 30-pin layout and will be called something like "ESP32 DEVKIT V1". I use these exact ones here now, which happen to include stronger USB connectors and arrive without pre-soldered pins (saving me from removing them much of the time!): https://www.aliexpre...1648850998.html
Amazon and other retailers have very similar boards with the same 30-pin layout as those.
Edited by mlord, 28 November 2022 - 01:29 PM.
#1245
Posted 28 November 2022 - 01:14 PM
You now specify an HCT device, and run it off 5 volts, then use resistors to level shift it down to 3.3 volts.
Is this to give 5 volts of output drive to the mount?
And another question; all the versions I've seen have a serial transmit line going to the GPS. Is this ever actually used?
Celestron mounts use 5V logic for the AUX ports, and at some point last year we discovered that using a 74HC125 (CMOS) at 3.3V with 5V pull-ups didn't actually give 5V logic -- the chip has internal clamping diodes that limit it to no more than about 3.8V. This is partly why it seems to take a lot of tweaking to work on various mounts.
The 74HCT125 (TTL) works much better with a 5V supply. And the newest design here has done away with the dreaded pull-up resistors in favour of inline current-limiting resistors and other changes. Go up the page to this post and read on: https://www.cloudyni...0#entry12306742
For the GPS, the TX-to-GPS has never been used in this project before, and the All-In-One project doesn't even wire it up. HOWEVER, the latest HomeBrew GPS design now DOES use that signal, to put the GPS receiver into a power-saving state after the hand-controller has finished with it. The same logic will be imported here in the near future. So wire it up!
EDIT: .. And I imagine the code may also put the GPS into power-saving mode whenever a WiFi or Bluetooth connection is active, since SkyPortal/SkySafari never use the GPS. But CPWI can use it, so I'll have to ponder on that.
Edited by mlord, 28 November 2022 - 01:34 PM.
#1246
Posted 28 November 2022 - 01:22 PM
While I am at it, here is my favourite 5V buck converter, which should fit the PCBs perfectly: https://www.aliexpre...3017156248.html
And here is the (excellent!) Beitian BN-180 GPS receiver: https://www.aliexpre...4405692761.html
Edited by mlord, 28 November 2022 - 03:21 PM.
#1247
Posted 28 November 2022 - 03:25 PM
mlord,
looking at the wiring diagram (post #1240), many of the resistor numbers do not match what is on the print circuit board at post #1239.
R5 and R6 as an example.
Edited by scopewizard, 28 November 2022 - 03:30 PM.
#1248
Posted 28 November 2022 - 03:32 PM
I'm not sure what .. exactly .. an "ESP32 Dev Module" actually is. Are all these modules out of China more or less the same? That is, if my LOLIN modules have 4MB of flash on them, can I likely expect them to work?
The ESP32 part is the postage stamp sized daughterboard on most of these larger boards. That part is normally the same. But which signals are brought out to which pins will vary from model to model. I use only the 30-pin DevKit versions.
#1249
Posted 28 November 2022 - 03:39 PM
mlord,
looking at the wiring diagram (post #1240), many of the resistor numbers do not match what is on the print circuit board at post #1239.
R5 and R6 as an example.
Yeah, I'll check it all over when the boards arrive. The values shown are probably correct, but maybe not always the names. I had a right fight with KiCad trying to get it to show useful info under the resistors instead of meaningless plain Rx names.
EDIT: Ah.. yes, the schematic editor renumbered them at some point.. Blah.
Okay, updated the schematic image above to no longer include the confusing "Rn" names. Just the values, which is what matters.
Edited by mlord, 28 November 2022 - 09:32 PM.
#1250
Posted 28 November 2022 - 04:16 PM
I've been following this project for quite some time and have finally gotten around to building it.
I'll start with what I'm working with.
Celestron SLT Mount with current firmware
NextStar+ HC with current firmware
KIT VERSION 2, October/2022 - https://www.cloudyni...2#entry12207213
VERSION "4.0", VERSION_DATE "2022-10-08" of the ino - https://www.cloudyni...1#entry12201324
After building (on a protoboard) and verifying everything was wired correctly I finally connected to the mount and powered everything on while monitoring the COM port (Verbose=1). I saw what appears to be typical output in the monitor window so I proceeded to send the "t" command and got responses that appeared to be correct. I grabbed the HC to see that motor commands were being displayed in the monitor window and noticed that I had error 17 on the HC. I immediately powered everything down and modified the HV resistors from 51K to 75K and tried again, still Error 17. I also tried 100K and was still getting error 17. I ran out of time so I had to walk away for a few days and after about a week I had some time to play again.
I verified that the wiring was still correct (HV = 100K) and powered up the mount again while monitoring the com port. Com monitor looked normal but still getting error 17. Tried adjusting HV resistors again, 100K, 82K, 75K, 68K, 51K, 39K - always error 17, always com working ok. No more time so set everything aside for a few more days.
In the meantime, my starsense camera arrived so I decided to get it mounted and make sure it was working correctly. Everything looked good so I decided to try the WiFi+BT project again without the starsense camera connected. This time, com monitoring appeared normal but the new starsense controller wasn't showing any errors. Sending a "t" command and the response looked good. Now I was curious, was it the HC or just luck? I connected the Nextstar+ HC and powered everything up. Com monitoring was normal but, error 17 on the Nextstar+ HC. Power down, swap in the starsense HC, power up - good com, no error. Odd but I decided to move forward and try to connect to the WiFi and see if I could get SkyPortal working. The Homebrew WiFi appeared on the list on my phone so I connected but it seemed to hang on obtaining an IP address and kept disconnecting.
I grabbed VERSION "4.8", VERSION_DATE "2022-11-22" of the ino and decided to give it a go. Connected kit to my computer, flashed it, and tried connecting to WiFi - it got an IP address and my phone seemed happy, great. Connect to the mount, power up, no com, no error on starsense HC. I now realized that there was a new wiring schematic V5, November/2022 so I reconfigured the wiring according to that schematic and tried it again with V4.8 ino still flashed. WiFi still connected but still no com in the monitor window. Sent a "v" command, response was verbose=0, sent it again, response verbose=1. Still not communicating with the mount. Verified wiring again and tried again - same result.
Flashed back to V4.0, still wired for V5, November/2022 - not communicating with the mount. Rewired to V2, October/2022 schematic - still flashed with V4.0 ino. Communication with the mount is working, can't connect to WiFi, same issue, does not get an IP then disconnects. So now I'm kind of stuck and hoping someone can give me a shove in the right direction.