Wixely / CelestronESPWifi

ESP based wifi adapter for Celestron telescopes
7 stars 0 forks source link

NexStar 6SE not responding #2

Open joeldhenry opened 3 years ago

joeldhenry commented 3 years ago

Hi, Thanks so much for your project! Perfect timing as I just got a 6SE and am looking to remote control it. i've Done the exact setup you have, except using a WEMOS D1 mini. I flashed the code onto the MCU and connect to it on my phone with the Skyportal App, However when I click connect i get a timeout of 3x "TCP: 3B 03 20 10 FE CF" and the app says the telescope isn't responding. Ive setup the variables as:

int RTSPin = 2 (GPIO2 -> Select) int UartTXPin = 4 (GPIO4 -> Serial Send) int UartRXPin = 5 (GPIO5 -> Serial Receive)

i know the RX & TX are the right way (same as your diagram).

Any Ideas?

Wixely commented 3 years ago

I don't have a Wemos to try but from Google I can see they are using Arduino pin naming scheme. I do know that pins 2 and 4 are mixed up when using arduino notation on esp so D2 = GPIO4 and D4 = GPIO2 so my first suspicion is that. I would try using different pins from 5 onward as they should match up OK. If you attach the keypad and monitor via serial on the Wemos you should see data from the keypad (hit buttons), that will at least diagnose if the scope is communicating at all.

joeldhenry commented 3 years ago

When I have the keypad attached & power on with ESP plugged into aux port I get "No Response 16". I've Tripple checked the schematic and tested connections and everything matches. But you are right, even if i disable all of the code except the TransmitData serialRX is doesn't receive back any serial data from the hand controller.

Wixely commented 3 years ago

You have to be aware that Pin 2 (gpio2) is not D2 and Pin 4 (gpio4) is not D4 and in the case of the wemos specifically, Pin 5 (gpio5) is not D5. Please make sure you are using GPIO pin layout and not the "D" notation layout.

If you still have issues then for a test I would disconnect the ESP TX and RST completely and connect the RX pin (plus GND and 3v3). With the RX only connected you should see data from the keypad in serial monitor assuming you have the pins correct - you may still need the diode for this but it might work without it.

You say it's in the Aux port so thats correct. I remember seeing posts online about the the other ports having a reversed pin layout on some scopes so be aware. Also I will point out that I commonly saw "Error 17" on they keypad often during development but I've never seen "Error 16". Google says these are references to each motor inside - interesting that your scope tries to communicate with 16 instead of 17 first but they effectively seem like the same problem and it would be due to pulling one of the wires high or low incorrectly.

joeldhenry commented 3 years ago

Yea i get an Error 16, and im 100% sure the pins match the code, but i give up, too scared of blowing up the scope haha. glad it works for you, but i cant replicate with my Nexstar 6SE

Wixely commented 3 years ago

i cant replicate with my Nexstar 6SE

That's a shame, there is always the chance there is some kind of different between our scopes and I understand completely about being cautious. It could be that your wemos is also a factor, possible that it has a defect or that it doesnt quite work exactly as my setup. You can see from the images folder that I developed it using a generic esp programmer (very similar to NodeMCU). The other thing I wonder is that maybe our cables our different? Patch cables and crossover cables exist for RJ12 so possible the colours don't match up to the same pins. And after checking the cable I bought and used for the project it appears lots of people in the comments are complaining about it being a crossover cable with the pins reversed!

joeldhenry commented 3 years ago

i have 2 thoughts, either its the cable pinouts from the nexstar, or its the firmware of the mount/controller.

A couple of things to note, you didn't mention in your schematic the actual pins and rotation of the telescope aux port, this would be really helpful for debugging. Also your diagram and sketch code do not match, you have GPIO5 as receiving and GPIO4 as transmitting, but use 4 are receiving and 5 as transmitting in your sketch. i know you mentioned this in my issue, but this was not in the original readme

joeldhenry commented 3 years ago

I think i uncovered the issue! the NexStar 6SE/8SE has seperate RX & TX Pins rather than the single serial pin your example shows.

post-55410-0-08126000-1494705015_thumb

joeldhenry commented 3 years ago

looking at at the diagrams. Arduino RTS -> -CTS_AUX3, Arduino TX -> RX_AUX3 are correct, but we also need Arduino RX <- TX . Which explains why i'm not receiving anything from the telescope. Plus your code says Pin5 is TX and Pin4 is RX which are backwards to the schematic.

Wixely commented 3 years ago

Plus your code says Pin5 is TX and Pin4 is RX which are backwards to the schematic.

Hi @joeldhenry Thanks for noticing that indeed you are correct, I'll try get this updated later today.

NexStar 6SE/8SE has seperate RX & TX Pins

Can you test this with a multimeter to see if they are indeed seperate, my 4SE has the TX and RX has seperate pins but they are shorted, these pins are each side of the 12v pin. This info would be good to add.

A couple of things to note, you didn't mention in your schematic the actual pins and rotation of the telescope aux port, this would be really helpful for debugging.

I think this is a good idea, will try to write up something soon.

Your diagram looks completely different in layout to my pins, where did you find this? I might need write a more generic approach to acommodate different scopes.

joeldhenry commented 3 years ago

thanks so much! i think very close to figuring out what is wrong with my setup! the diagram i got was from https://www.cloudynights.com/topic/576390-looking-for-8se-aux-labelled-pinout/, ill confirm if my pins are shorted too, i suspect you are correct and they are. I also found this document http://www.paquettefamily.ca/nexstar/NexStar_AUX_Commands_10.pdf which page 11 has a pinout. This document has heaps of information about how the scope communicates too if you are interested!