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

DIY Ethernet dongle for AUX port. Anyone interested?

  • Please log in to reply
689 replies to this topic

#551 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 15 August 2021 - 06:33 AM

The build instructions are still here in this post:  https://www.cloudyni...7#entry10902090

 

The same post describes the parts required.



#552 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 14 January 2022 - 09:43 AM

For anyone lingering here and getting understandably put-off by the number of posts and lack of up-to-date instructions, I do plan to assemble a couple of new ethernet dongles from scratch here soon, and document / post drawings and photos etc..

 

So.. stay tuned!


  • Cyrano likes this

#553 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 14 January 2022 - 12:24 PM

Well, here's the first step:  gathering the necessary components for the job.

 

There are quite a few choices of parts that one could use, and many of those combinations are described earlier in this thread (Post #434).

 

Here, I'm going to narrow it down to the easiest ones to work with.  So to build this version of the Celestron-AUX to ethernet adapter, we need these items:

 

1. A Sparkfun Arduino Pro Micro 5V/16Mhz board, or a generic "clone" thereof.  These little boards have an Atmega32U4 chip on them, with built-in USB for programming/debugging, and an extra on-board serial port that this project will use for the AUX bus interface.  It MUST be a 5V/16MHz version of a Pro Micro.  These usually come with "header pins" (shown), but it is easier to build if you do not attach/use those pins.  You'll also need a USB micro-B cable for programming the Arduino -- many of us already have one from a previous generation mobile phone.

 

pro_micro_5v_16MHz.jpg

 

2. An ethernet module with a clearly labelled 5V power input.  There are lots of suitable modules out there, but I'm going to use one with a Wiznet W5500 chip on it.  If it lacks a 5V power input, then give it a pass, or read back in this long thread for alternative ways to make that work.  In the second photo below, the top-left pin is labelled "5V".

 

w5500_ethernet_top.jpg w5500_ethernet_bottom.jpg

 

3. A DC-to-DC Step-Down "buck" converter, that will accept up to at least 20V input and provide 5V output power.  These tiny switching power supplies come in many, MANY shapes and sizes.  Some have a tiny little variable resistor that can be adjusted with a screwdriver to get any output voltage one wants.  Others come pre-wired for an exact output voltage, such as the 5V we need here.  Any of these will do, but if an adjustable one is used, then a volt-meter will be needed to measure the output while adjusting it to give exactly 5.0V the first time.  I prefer the really small ones with a fixed 5V output, but any will do.  It must not be a linear regulator, so nothing with a chip marked with AMS1117 or 78x05 on it.

 

buck_converters.jpg

 

4. A 1N4148 small signal diode.  Yes, that exact part.  Like everything else here, these are commonly available on Amazon, eBay, AliExpress, etc..

 

5. A 50K-ohm resistor, rated for either 1/8watt or 1/4watt.  The 50K-ohm is an approximation:  anything from 47K-ohm to 60K-ohm will work in most situations.  Here, I happen to have a 51K-ohm resistor, so that's what I will use in my own build.

 

diode_and_resistor.jpg

 

6. A 6P6C / RJ12 / RJ-24 telephone style connector or cable.  The simplest way is to begin with a 6-wire flat cable that has a 6P6C plug on each end of the cable.  Only one connector is needed, so cut the cable, leaving perhaps 6" to 12" of cable with a plug on the end.  Separate and strip the tiny wires.  Another way to do it is with a 6P6C Jack, along with a correctly wired 6P6C cable with a plug on each end.  That's how I often do it, but it requires more pieces.  So for this version, I will use a short length of flat cable with a 6P6C plug on one end.

 

6p6c_cable.jpg

 

So if you want to build your own version of this project, those are the parts to acquire.  One will also need a soldering iron, really thin flux-core solder, a small amount of extra wire, and some fine wire strippers.  I will follow up in a day or three with assembly instructions. 

 

Summary:  Six (6) parts, totalling $15-$30.

 

everything.jpg

 

After building it, one normally fashions a protective shell of some sort for it.  My favourite method is to use a short length of 2" heat shrink tubing.  Or even just wrap the finished circuit with a few layers of electrical tape.  Both options are very quick and cheap.


Edited by mlord, 14 January 2022 - 03:07 PM.

  • aughtago, JethroXP and BrushPilot like this

#554 mikenoname

mikenoname

    Apollo

  • *****
  • Posts: 1,347
  • Joined: 29 Jan 2015
  • Loc: Death Valley Region (Bortle 2 - SQM 21.9+)

Posted 15 January 2022 - 12:04 AM

Testimonial: I have been using one of these for many months now and they work great! Resolved all of my communication errors and issues with my Evolution mount that I was having with both the HC and CPWI.


  • Cyrano and mlord like this

#555 JethroXP

JethroXP

    Viking 1

  • *****
  • Posts: 501
  • Joined: 12 Aug 2020
  • Loc: Duvall, WA, USA

Posted 15 January 2022 - 10:40 AM

Well, here's the first step:  gathering the necessary components for the job.

 

There are quite a few choices of parts that one could use, and many of those combinations are described earlier in this thread (Post #434).

 

Here, I'm going to narrow it down to the easiest ones to work with.  So to build this version of the Celestron-AUX to ethernet adapter, we need these items:

 

 

After building it, one normally fashions a protective shell of some sort for it.  My favourite method is to use a short length of 2" heat shrink tubing.  Or even just wrap the finished circuit with a few layers of electrical tape.  Both options are very quick and cheap.

Really appreciate your commitment to this project and giving so freely of your time and experience to the community!


  • mikenoname and mlord like this

#556 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 15 January 2022 - 12:55 PM

Here is the wiring diagram for this project, showing exactly how things should be connected.  Click on the drawing for a clearer view of it.

 

wiring.png

 

NOTEOne change from the original designa second, identical 1N4148 diode is required in the circuit, between the buck converter and the Arduino+Ethernet.  This diode is needed to permit the USB cable to be connected for debugging purposes.  Without the extra diode, one must NEVER connect the project to the telescope mount while USB is also connected.  So, safer to just include it, especially since one normally gets several of them in a pack when purchasing. smile.gif

 

UPDATE:  Added the optional "mode switch", for selecting "Access Point" (DHCP client) mode if/when needed.

 

EDIT:  Updated the wiring diagram again, to reflect actual diode/resistor wiring in my prototype.  smile.gif


Edited by mlord, 16 January 2022 - 09:14 AM.

  • aughtago likes this

#557 aughtago

aughtago

    Explorer 1

  • -----
  • Posts: 61
  • Joined: 10 Aug 2020

Posted 15 January 2022 - 02:57 PM

I have ordered the parts today, that, the programming, and the diagram are probably the key items i need to build this. I am an electrician by trade and have dabbled in electronics, but never played with an Arduino before, I look forward to your step by step. Thanks for taking the time to put this all together so we less knowledgeable can follow along.


  • mlord likes this

#558 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 15 January 2022 - 03:42 PM

NOTE:  One change from the original designa second, identical 1N4148 diode is required in the circuit, between the buck converter and the Arduino+Ethernet.  This diode is needed to permit the USB cable to be connected for debugging purposes.  Without the extra diode, one must NEVER connect the project to the telescope mount while USB is also connected.  So, safer to just include it, especially since one normally gets several of them in a pack when purchasing.

 

The wiring diagram above has now been updated to show this.


Edited by mlord, 15 January 2022 - 03:43 PM.

  • aughtago likes this

#559 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 15 January 2022 - 04:19 PM

Well, I have assembled my own version of this project now.  To make life easier for me, I cheated and removed the header pins from the Ethernet module as well as from the buck converter.  This was possible because I have a hot-air de-soldering station that makes it very easy.  But most folks should not attempt that.  Instead just leave the factory header pins (if any) in place.  They can always be snipped shorter (or bent) if they get in the way, and may instead make convenient attachment points for the wires that bind it all together.

 

I plan to wrap mine in heat-shrink tubing (or electrical tape, same idea), so have used 3M mounting tape to secure the various pieces back-to-back for a smaller overall build:

 

assembly1.jpg assembly2.jpg

 

After that, I began wiring things up.  Doing it all tightly like this makes it more difficult, so you may want to spread things out a bit more and use longer interconnect wires.  But here's the finished product:

 

wired2.jpg

 

Regardless of how tightly or loosely you wire it, note how I have placed the first diode and resistor together across the arduino board, just behind its USB connector.  This puts them in a safe position where they won't be disturbed.  One just has to be careful not to have their wires accidently touching the USB connector or any other exposed metal in the vicinity.  smile.gif

 

Speaking of those diodes:  They each have a black band around one end.  That black end has to be oriented as shown in the wiring diagram.  Getting it wrong way around will cause the circuit to not work.

 

I have also taken the Arduino code from earlier in this thread, and removed unneeded stuff and made some changes for use with the Pro Micro board.  I'll discuss and provide that in a subsequent posting, but it did work first try and I now have a working ethernet dongle.  smile.gif  One just configures the software/apps to treat it as a "Celestron WiFi" type of connection, even though it uses ethernet instead of WiFi.

 

Note that this dongle is for a standalone, point-to-point ethernet connection between the mount and a computing device (eg. laptop).   The various astronomy software/apps refer to this as "Direct Connect" mode.

 

If you want to connect it to an existing home network (LAN), then there's an extra step required:  wire a small switch between pin 8 and GND on the Arduino.  When the switch is closed before power-on, it will connect to an existing network using standard DHCP.  This is what the various software/apps refer to as "Access Point" Mode.


Edited by mlord, 16 January 2022 - 09:26 AM.


#560 Axident

Axident

    Lift Off

  • -----
  • Posts: 21
  • Joined: 02 Nov 2021

Posted 15 January 2022 - 04:31 PM

Hi.

Thank you so much.
Great feature to make both work as both AP and ad Hoc.

Edited by Axident, 15 January 2022 - 05:06 PM.


#561 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 15 January 2022 - 04:53 PM

If you want to connect it to an existing home network (LAN), then there's an extra step required:  wire a small switch between pin 8 and GND on the Arduino.  When the switch is closed before power-on, it will connect to an existing network using standard DHCP.  This is what the various software/apps refer to as "Access Point" Mode.

Here's mine, with a small slider switch added on for that purpose.  I soldered mine to the side of the RJ45 shell, and wired the middle pin to GND (Ground), and one of the other two pins to Pin-8 of the Arduino board.  Works fine.  smile.gif

 

mode_switch.jpg



#562 aughtago

aughtago

    Explorer 1

  • -----
  • Posts: 61
  • Joined: 10 Aug 2020

Posted 15 January 2022 - 05:05 PM

I will need that ethernet DHCP option, as I control my mount remotely and the via a laptop at the scope using ethernet and remote desktop. I do have a separate ethernet jack from the observatory to my ethernet switch in the house, so hopefully everything plays nice. is the switch necessary for debugging or can I just permanently jumper it? 

 

also, I'm pretty sure I understand the pin 8 to grd, but if you could add it to the schematic , that would be great!



#563 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 15 January 2022 - 05:07 PM

.. is the switch necessary for debugging or can I just permanently jumper it?

The wiring diagram has now been updated to show the  "mode switch".  If you want it permanently in "access point" (DHCP client) mode, then just permanently wire Arduino Pin-8 to any of the GND connections, without bothering to add the switch.

 

My supply of 2" diameter heat-shrink tubing is actually a bit large/bulky for this project, so I've ordered a short roll of 1.25" diameter heat shrink instead.  It should fit very nicely once it arrives -- hopefully on Sunday (tomorrow).

 

Cheers


Edited by mlord, 15 January 2022 - 05:31 PM.


#564 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 15 January 2022 - 09:32 PM

An important note about assembling this project:  If you chose to use an Adjustable Buck converter, then you must somehow hook it up to a 12V power source, and adjust the output of the buck converter to 5V, before wiring it to the Arduino or Ethernet module!!

 

Okay, good.

 

Now for the tricky bit.. software/firmware.  The Arduino board has to be programmed.  For that, you will need these two files (attached below).  Save them to your computer and remember where you put them.

 

Now to set up the Arduino Integrated Development Environment (IDE):

 

1. Ensure your computer has a Java runtime environment (JRE) installed.

 

2. Visit https://www.arduino.cc/en/software and download the latest released version of the Arduino IDE for your computer's operating system (teal coloured box at right on that page).  Currently showing version 1.8.19 as of right now.

 

3. Install it, and launch it.  The IDE window should pop up with a sample "empty" sketch (aka. "program") shown.

 

4. Click on File --> Save As...
Change the "Name:" to "new_ether", and then click Save at bottom right.

 

5. Quit/Close the Arduino IDE.  Locate a file called "new_ether.ino" within a "sketchbook" folder somewhere on your computer.  Replace its contents with those of the new_ether.ino.txt file that was attached to this post.

 

6. Launch the Arduino IDE again.  It should pop up with the new_ether.ino sketch, all 614 lines of it!

 

7. Now, time to install a bug-fixed copy of the Ethernet2 library:
Click on Sketch --> Include Library --> Add .ZIP Library
Select/install the Ethernet2.zip file that was attached to this post.

 

Note: if you already had a working Arduino setup with an Ethernet2 library, you will need to remove that existing Ethernet2 library and then install the one I have provided --> it has a couple of important bug fixes needed here.

 

8. Connect your Pro Micro board to the PC with a USB micro-B cable.  The instructions here assume you have already assembled the project around this board.

 

9. Configure Arduino for the right kind of board:

Click on Tools --> Board --> Arduino Leonardo  (same board type as Sparkfun Pro Micro).
Click on Tools --> Port  --> and select the serial port for the Arduino board.

 

10. Click on Tools --> Serial Monitor.

A new window should pop up.  Use the menus on the bottom of that window to change
the baud rate to 115200.  Now leave the window open, but move it aside for a moment.

 

11. Click on Sketch --> Upload (or click on the "Right-Arrow" icon).
It should build the program, and display something like this:

  Sketch uses 16326 bytes (50%) of program storage space. Maximum is 32256 bytes.
  Global variables use 701 bytes (34%) of dynamic memory, leaving 1347 bytes for local variables. Maximum is 2048 bytes.

There should be NO OTHER MESSAGES!!

And then it should show "Done uploading." in the teal coloured middle bar area.

 

12. If this has all worked, then the Pro Micro board has now been programmed.  Congratulations.
There should be some output now in the "Serial Monitor" window. It should show this:

    HomeBrew-AMW007-9.0.0.0, 2022-01-15T12:00:00Z, ESP32-2.0
    evo_wifi ON
    1.2.3.4
    Broadcast
    Broadcast
    ...

If you see that, then.. so far, so good!

Leave everything as-is, USB cable still connected, Serial Monitor window still open.

 

13. Now power off the telescope mount, and plug the ethernet project into an AUX port, with it STILL connected over USB to the PC.  Ensure a hand-controller is also connected to the mount (needed for testing purposes only).

 

14. Power on the mount, press the slew buttons on the hand-controller a few times, and then power off the mount again within 5 seconds or so.

 

There should be one or more lines with "auxbus_rx" on them, vaguely like these:

    000073675 auxbus_rx: 3b 03 0e b4 fe 3d
    000074165 auxbus_rx: 3b 03 0e 10 fe e1
    000074178 auxbus_rx: 3b 07 10 0e fe 07 11 00 62 63
    000074195 auxbus_rx: 3b 03 0e 10 05 da

 

If not, something is wired wrong!!  Unplug it from the mount, and seek help!

 

15. Otherwise, fire up CPWI or Skyportal, and tell it to connect to the telescope over WiFi in Direct Connection mode.  The software/app should connect within 5-10 seconds max. If not, power off the mount and seek help!

Otherwise, try slewing the mount from the software/app.  If it works, you are all set!

 

Easier done than said!  smile.gif

Attached Files


Edited by mlord, 15 January 2022 - 09:37 PM.


#565 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 15 January 2022 - 09:55 PM

One more thing needs "fixing" in the Arduino stuff.  The serial port "receive buffer" is too small by default.  This can cause issues when a StarSense AutoAlign camera is used over Ethernet.

 

So.. search for a file on your computer called:

   hardware/arduino/avr/cores/arduino/HardwareSerial.h

 

Edit that file, and locate this line (line 49 in my version here):

 

   #if !defined(SERIAL_RX_BUFFER_SIZE)

 

Insert a new line, immediately before/above that line.  This new additional line is:

 

   #define SERIAL_RX_BUFFER_SIZE 128

 

Save/exit.

 

Fire up the Arduino IDE again, and re-upload the new_ether sketch to your project.  Done.

 

Cheers

 

project.jpg


Edited by mlord, 15 January 2022 - 09:59 PM.

  • Sakcyb likes this

#566 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 16 January 2022 - 09:15 AM

Wiring diagram updated again: moved the resistor to after the second (red) diode, matching how I actually wired mine.  smile.gif  Also rearranged how the resistor and other (green) diode are pictured, to match the photo of my own assembled version.

 

EDIT:  Oh, and I really should emphasise this:  The wire colours in the diagram above mean nothing.  Do not rely upon wire colours for anything here.  Electrons don't care about wire colours!!!  smile.gif

 

Instead, wire positions are what matter -- the placement and sequence of the six wires of the 6p6c/RJ-12 connector are what matter, not the colours of those wires, nor the colours in my diagrams and photos!!

 

Cheers!


Edited by mlord, 16 January 2022 - 08:34 PM.


#567 synfinatic

synfinatic

    Viking 1

  • *****
  • Posts: 842
  • Joined: 22 Dec 2013
  • Loc: San Jose, CA

Posted 16 January 2022 - 01:01 PM

this is a great project!  Any plans on hosting the files on some place like github?



#568 cdvideo

cdvideo

    Explorer 1

  • -----
  • Posts: 61
  • Joined: 17 Dec 2018
  • Loc: Hamilton Ontario Canada

Posted 16 January 2022 - 03:53 PM

where are you getting your parts I have looked at Amazon Canada with no luck for the network adapter most are from China on a very slow boat.  I see a few on Amazon USA then again shipping is higher that the items than in Canada. Looked at Digikey but did not find what one with 5V power input a few 3.3V 

 

If I go with 3V adaptor then I require another unit to bring down the input to 3 Volts for the network adapter

 

Is this one sutible

 

 

https://www.amazon.c...aps,87&sr=8-31 



#569 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 16 January 2022 - 04:35 PM

where are you getting your parts

From my "parts bin" here.  smile.gif

 

And yup, Amazon Canada appears to no longer have any local sources for W5500.  Must've sold out when I restarted this topic!  smile.gif

 

So, my advice:  Save money and just order one direct from Asia, with regular (not economy) SpeedPak shipping.  eBay, AliExpress, or even through Amazon.  Right now, stuff is taking about 2-3 weeks to Canada.

 

Or.. you could use a ENC28J60 module -- some of those are also available with built-in 5V-->3.3V conversion.  But with that chip, things get more complex, and the new_ether.ino code here lacks support for that chip.  The older ether.ino project code earlier in this thread works with it though, but setting up and patching the Arduino libraries is a bit messier.

 

Give me a day to mull over whether or not to support the ENC28J60 in the "new" version of this project.


Edited by mlord, 17 January 2022 - 09:19 AM.


#570 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 16 January 2022 - 04:55 PM

this is a great project!  Any plans on hosting the files on some place like github?

It is currently "hosted" here, in this thread on CloudyNights.

I will eventually put it on my own server rather than Microsoft's (github) servers, though.

 

Cheers



#571 Woody218

Woody218

    Mariner 2

  • *****
  • Posts: 282
  • Joined: 01 Jul 2020
  • Loc: Bismarck, ND

Posted 16 January 2022 - 04:56 PM

Wouldn't this accomplish the same thing?

 

https://vilros.com/p...AiABEgIjrvD_BwE



#572 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 16 January 2022 - 04:58 PM

Wouldn't this accomplish the same thing?

 

https://vilros.com/p...AiABEgIjrvD_BwE

Too bulky, and you'd have to work out your own wiring for it.



#573 mlord

mlord

    Fly Me to the Moon

  • *****
  • topic starter
  • Posts: 5,099
  • Joined: 25 Oct 2020
  • Loc: Ottawa, Canada

Posted 16 January 2022 - 05:08 PM

Give me a day to mull over whether or not to support the ENC28J60 in the "new" version of this project.

All I can say is, Ugh!  smile.gif   They are already supported in the original versions of the project earlier in this thread.  But I really do NOT want to clutter up the "simplified" build by trying to include them again.  The ENC28J60 is low performance and barely keeps up anyway.  Debugging with it can be miserable too, because there's not much memory left over for such when using that chip.

 

A good alternative, if you can find a local supplier, would be a slightly older Wiznet W5100 module.  Those are also often available with a 5V input for an easy build, and are software compatible with the W5500 that replaced them.  Requires a one-line change to the Arduino sketch:

 

   #include <Ethernet.h>  ## instead of Ethernet2.h for W5500

 

Note that the W5500 module that I used here is about CAD$8 delivered from Asia (AliExpress) by early/mid February.

 

Cheers


Edited by mlord, 17 January 2022 - 09:35 AM.


#574 aughtago

aughtago

    Explorer 1

  • -----
  • Posts: 61
  • Joined: 10 Aug 2020

Posted 16 January 2022 - 05:56 PM

where are you getting your parts 

 

I ordered from Amazon USA, but saw they were also available at Walmart , do they ship to CA?



#575 cdvideo

cdvideo

    Explorer 1

  • -----
  • Posts: 61
  • Joined: 17 Dec 2018
  • Loc: Hamilton Ontario Canada

Posted 17 January 2022 - 09:43 AM

I check Walmart out and the W5500s are there same as amazon but are 3.3 volt powered not 5 volt as per the required spec 

 

The working voltage of 3.3V, I/O and 5V voltage signal.




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