mafredri / asustor_as-6xxt

All things ASUSTOR AS-6XXT sans ADM
20 stars 4 forks source link

Request for more details on serial port connection #3

Open Woodgnome opened 2 years ago

Woodgnome commented 2 years ago

I recently acquired an AS5304T - not sure if your workaround works for this series as well, but I can't see why not. It's just a PC in a different shell.

In any case, I have no problems with handling Linux, but in boot.md you write:

Beware, you will not be able to inspect the boot process without connecting to the serial port on the motherboard!

Can you elaborate a bit on how you did this? On the AS5304T there are two headers (soldered), one 4-pin header labeled SIO UART and another 8-pin header with no other label than J# (which seems to be the generic name for headers on the motherboard, J1, J2, etc.).

What did you use to connect and which header on the motherboard? Are there any identifying labels?

mafredri commented 2 years ago

On the AS5304T it may be possible to use HDMI instead of serial, does it come up on boot? Works on my AS6204T at least (BIOS, boot, etc).

There are no clear labels on either AS604T or 6204T, and I keep forgetting to snap a photo of my AS6204T (and thus also forgetting which pin-header is the serial port).

Btw, ASUSTOR boards use RS-232 (TTL won't work).

Here's a pic from my AS604T:

It's just J6. The pinout is: TX, GND, RX, VCC (I may be mixing up TX/RX)

You could use a multimeter and try to find a pin-header with this configuration: _, GND, _, VCC, fairly certain it will be the pins for RS-232.

On my AS6204T, the headers look like this:

If I recall correctly, the serial port is actually the top row of J2 (as seen from the image) but I may misremember (could also be J3), I'll need to open up my AS6204T and snap a picture to be sure. 😄

Hope this helps.

Btw, I have two other projects that may interest you:

Woodgnome commented 2 years ago

Looks pretty similar to the AS5304T, so it's probably the 4-pin header labeled SIO UART on AS5304T. One of the two middle pins is GND, so at least one pin matches the pinout.

Are you using an old style serial connect like the one bundled with PCs years ago (but only 4 pins connected) or something else? image

mafredri commented 2 years ago

Sounds promising, if you want to post a picture I can take a look at it.

I don't use that adapter, but it should work as long as you get the pinout right. This is an adapter I received from ASUSTOR once upon a time:

The TRS3232EC chip is (to my understanding) just there for ESD protection for the motherboard RS-232 pins (trs3232e.pdf). The blue DB9 connecctor you see sticking out at the top is a standard USB -> RS-232 (DB9) adapter, like this:

In a pinch you could wire up TX/RX/GND straight form the motherboard to the adapter:

I don't think VCC is needed, but I haven't tried this myself on the ASUSTOR (only QNAP with 3.5mm AUX adapter). Just be careful to not wire up VCC to RX/TX or the line might get fried.

Edit: Don't do this, it will fry the ASUSTOR serial port.

Woodgnome commented 2 years ago

As far as I can tell UART (J4) uses other signal levels than RS-232, so it's probably not a good idea to connect directly to the PC COM port. On a side note I also think the pinout you're referring to is actually UART (which according to some sources is incorrectly used interchangeably with RS-232) because RS-232 does not specify a VCC, whereas UART does.

I think it would be fine to wire up the correct pins directly without the ESD module (that's basically what happens with a serial cable as far as I'm aware), but without a signal analyzer to determine the right pins is't just guesswork. A bit too risky in my opinion - I'll try to ask for pinout at https://support.asustor.com/.

As for the HDMI output there is by default only a blinking caret. If you install Asustor Portal you get an output that can be navigated with keyboard and mouse, but you need extra apps to use the NAS as a media center. Unfortunately it seems like there is no apps for playing back local media (which seems kind of weird, why even bother with HDMI then?)

mafredri commented 2 years ago

As far as I can tell UART (J4) uses other signal levels than RS-232, so it's probably not a good idea to connect directly to the PC COM port. On a side note I also think the pinout you're referring to is actually UART (which according to some sources is incorrectly used interchangeably with RS-232) because RS-232 does not specify a VCC, whereas UART does.

That actually makes a lot of sense. Would also explain why the TRS3232EC chip is present on the adapter I got from ASUSTOR (it has a charge pump to bring the signal to RS-232 levels).

If it really is just UART, I guess you could try hooking up RX/TX/GND to an Arduino or similar. If you power up the machine you should be able to measure which pin is VCC, the remaining are TX/RX and hooking TX/RX to TX/RX (vs RX/TX) shouldn't do any damage (assuming both are the same voltage, e.g. 3.3V). Another option is to follow the trace to figure out what is what or try to find VCC via a capacitor close by (see if there's continuity between the pin and either side of the cap, very likely VCC in that case).

As for the HDMI output there is by default only a blinking caret.

I was thinking about output during bootup. For instance, if you hook a keyboard to the back (front is unreliable during boot in my experience) and keep hitting DEL repeatedly as you power on (or possibly F2 or F10). Does it eventually output BIOS? If yes, you don't really need the serial output.

My AS604T does not support HDMI output in firmware, output is only enabled once the kernel module is loaded (they had some homebrew EFI BIOS on this unit lol, it's a mess). My AS6204T however has full HDMI support in firmware, so it can be an alternative to serial.

Btw, the reason these units have HDMI is that ASUSTOR once upon a time supported Kodi, and advertised it as a full media center. Once they stopped, it became pretty much useless on all units that had it, and was a hard blow to many customers who bought it for that exact reason. More about that in this Reddit comment.

From their facebook page: "We have received a cease and desist letter from an organisation that we aren't allowed to mention to not promote or host players capable of playing Dolby and DTS content in any form. This is the reason why we have removed support. We appreciate your support for us in the past and hope to continue fulfilling your NAS needs in the future. We also aren't happy about removing features from our products either, but we hope you are able to understand." Furthermore they removed AC3, eAC3, trueHD, DTS codec playback support from FFMpeg and X.org.

mafredri commented 2 years ago

That actually makes a lot of sense. Would also explain why the TRS3232EC chip is present on the adapter I got from ASUSTOR (it has a charge pump to bring the signal to RS-232 levels).

And now that I thought about it, I had a recollection that TX/RX were mapped to the UART pins of the chip. Measured with my multimeter and yeah, it's ROUT1 and DIN1 (logic data output/input from UART) that are mapped to TX/RX. I didn't think about looking this closely last time I checked it. 😄

mafredri commented 2 years ago

Since this came up, I'm thinking of wiring up my serials ports a bit more permanently, found the MAX3232 chip (max3232.pdf) that seems like a good option.

These are readily available and there's also a smaller version for DIY soldering. On AliExpress they are called "RS232 <-> TTL", I'm unsure why TTL is mentioned but from what I can tell they're wired up the same as the ASUSTOR adapter (ROUT1 and DIN1, logic data output/input to/from UART).

PS. The security lock a pretty good place to route out the wires.

tehkillerbee commented 2 years ago

@mafredri FYI, the MAX3232 based modules shown in the picture, commonly found on ebay, aliexpress etc. are notoriously unreliable since knockoff chips are almost always used. I am not sure where to get modules that are using legit MAX3232 chips but they can probably be purchased somewhere.

However instead of using a RS232 to UART TTL adaptor, it might be easier just to get an FTDI USB to UART TTL cable such as this 3.3V UART TTL cable or this 5V UART TTL cable and add a small header to the back panel of the Asustor. Of course the correct TTL voltage levels must be used and I do not think anyone in this thread has mentioned whether the Asustor uses 5V or 3.3 TTL levels. But if the asustor adaptor uses a TRS3232EC based chip, it is most likely 3.3V TTL uart levels on all Asustor models.

mafredri commented 2 years ago

Thanks for the heads-up @tehkillerbee! I was a bit sketched out by one of the descriptions mentioning "don't use above 120 kbps".. 😄

I do have plenty of USB TTL adaptors (knockoffs) but once upon a time I fried the serial port on an AS1002T by using them. It worked fine with the ASUSTOR adapter (before) so this may be why I was under the impression that TTL won't work. Could also be that I just got the pinout wrong and managed to fry it by testing both 3.3V and 5V.

Woodgnome commented 2 years ago

Hitting all the F keys and Delete key in sequence (I don't know which one did the trick) during boot I managed to get into a boot screen*:

Hitting Escape at this point takes you into BIOS where you can configure boot (and completely disable the eMMC drive as a boot option). Great simple suggestion, cheers!

Feel free to close this issue if there's no more need for it to be open.

* I had the NAS connected to my OLED TV to begin with and didn't see the boot screen. I suggest using a PC monitor to anyone else, because they just seem to handle weird input better than a TV.

Woodgnome commented 2 years ago

However instead of using a RS232 to UART TTL adaptor, it might be easier just to get an FTDI USB to UART TTL cable such as this 3.3V UART TTL cable or this 5V UART TTL cable

For reference I measured 3.3V on the UART pins.

mafredri commented 2 years ago

@Woodgnome awesome, glad you got it working, and thanks for sharing your measurements. And good luck getting Linux up and running. Feel free to throw me a Q if there's anything you're wondering about (this repo is good a place as any, I enabled Discussions). I've spent way too much of my time analyzing this hardware and happy to share. 😄

PS. Might keep this issue open until(/if) I get around to documenting the serial port better, some good info in here.

Ogglord commented 11 months ago

Very interesting thread! Now I not only want Linux on my ADM. I want serial working too 🤣. I have a USB<->DB9 lying around. Would this little chip be enough to get my AS-604T connected? It's awfully cheap and in stock RS-232 To TTL Converter MAX3232IDR 3232chip