News for hackers. Stuff that matters.
Re:Raspberry Pi 4 as a USB-C peripheral by rkagerer on Saturday November 02, 2019 @08:15PM (#21431072)
You can also do a USB client on a $1.50 AVR chip: https://www.obdev.at/products/vusb/index.html

Source: Compiled and connected a mouse/keyboard firmware running on an ATtiny861a using internal RC oscillator.

Re:Raspberry Pi 4 as a USB-C peripheral by IshKebab on Sunday November 03, 2019 @06:28AM (#21433268)
Why would you do that though when there are a gazillion Cortex-M chips available that support hardware USB? Fast USB and you don't have to use AVR.

Hell, Atmel even sells Cortex-M chips with High Speed USB-2 support (reasonably hard to find; most are only Full Speed).

Re:Raspberry Pi 4 as a USB-C peripheral by HeyLaughingBoy on Sunday November 03, 2019 @11:48AM (#21434949)
Tool Familiarity?

I've been doing embedded systems large and small for decades but before this year, never put anything with an ARM into production.

AVRs are still my go to for most things because I know them well and have all the tooling ready to go.

Re:Raspberry Pi 4 as a USB-C peripheral by 127 on Sunday November 03, 2019 @06:56AM (#21433366)
Full ATmega32U4 board is 2.50 and doesn't need any hacks to work.
Re:Raspberry Pi 4 as a USB-C peripheral by rkagerer on Sunday November 03, 2019 @08:15AM (#21433673)
Could you provide a link to that $2.50 price?
Re:Raspberry Pi 4 as a USB-C peripheral by HeyLaughingBoy on Sunday November 03, 2019 @11:46AM (#21434931)
Aliexpress. Amazon. eBay.
Re:Raspberry Pi 4 as a USB-C peripheral by rkagerer on Sunday November 03, 2019 @02:30PM (#21436004)
Hmm, quick Amazon search I'm seeing $5-6, more if you're outside USA. https://www.amazon.com/s?k=ATmega32U4
Re:Raspberry Pi 4 as a USB-C peripheral by HeyLaughingBoy on Monday November 04, 2019 @07:50AM (#21441116)
It varies and you can't always find the same price. The last price I paid for Nanos on Amazon was 5 for $17. Aliexpress is cheaper than that (that's where they're usually under $3), but I can't always wait that long.

My bad: forgot we were talking 32U4. Here's a link for $2.70: https://www.aliexpress.com/item/32846843498.html?src=google&...

Re:Raspberry Pi 4 as a USB-C peripheral by rkagerer on Tuesday November 05, 2019 @06:21AM (#21451360)
Thanks!
Re:Raspberry Pi 4 as a USB-C peripheral by kees99 on Saturday November 02, 2019 @06:48PM (#21430659)

  [R]ecent update to the Raspberry Pi 4 bootloader
  (...) enables data over the USB-C port
Am I reading this right that RPi4 has five usable USB ports, i.e. unlike earlier models, port on bottom left of the board can carry data along with power? This is awesome!
Re:Raspberry Pi 4 as a USB-C peripheral by fanf2 on Saturday November 02, 2019 @07:24PM (#21430836)
USB-C includes a USB-2 management channel in addition to the high-bandwidth lanes. It is used for things like advanced power delivery negotiation. On the Raspberry Pi 4, the USB-C port has no high-bandwidth lanes, and it only uses passive power negotiation.
Re:Raspberry Pi 4 as a USB-C peripheral by cesarb on Saturday November 02, 2019 @10:14PM (#21431599)
> USB-C includes a USB-2 management channel in addition to the high-bandwidth lanes. It is used for things like advanced power delivery negotiation.

No, all the power delivery negotiation in USB-C, both the basic one using only passive resistor values and the advanced one using the USB-PD protocol, is through the configuration channel pins, which is a separate pair of pins completely independent from the USB 2.0 pins in the middle. (The configuration channel is implemented incorrectly on the Raspberry Pi 4, however; it shorts together the pins, while they should be separate, so it fails with advanced cables which use both pins; and when powered through a source other than the USB-C connector, it incorrectly sources 5V to the USB-C port even when it shouldn't.)

Re:Raspberry Pi 4 as a USB-C peripheral by mmastrac on Saturday November 02, 2019 @08:55PM (#21431273)
This seems to be in opposition to the blog post. In addition, according to the schematic there's USB-2 over that USB-C port:

https://www.raspberrypi.org/documentation/hardware/raspberry...

Re:Raspberry Pi 4 as a USB-C peripheral by hardillb on Saturday November 02, 2019 @06:49PM (#21430667)
Yep
Re:Raspberry Pi 4 as a USB-C peripheral by p1mrx on Saturday November 02, 2019 @08:06PM (#21431035)
Yay, that feature was previously only available on the Pi Zero. Does anyone know if this will work on older computers, using a USB A-to-C cable?
Re:Raspberry Pi 4 as a USB-C peripheral by hardillb on Sunday November 03, 2019 @05:42AM (#21433141)
Yep, should work fine with a USB-A to USB-C cable as well
Re:Raspberry Pi 4 as a USB-C peripheral by jpablo on Saturday November 02, 2019 @11:44PM (#21431997)
Also in the PI 3A, but needs a weird cable.
Re:Raspberry Pi 4 as a USB-C peripheral by mmastrac on Saturday November 02, 2019 @05:53PM (#21430369)
Site is getting a bit slow - mirror here: http://archive.is/3bp5L
Re:Raspberry Pi 4 as a USB-C peripheral by rwha on Sunday November 03, 2019 @08:35AM (#21433773)
cloudflare (1.1.1.1) is resolving archive.is to 127.0.0.5 ??
Re:Raspberry Pi 4 as a USB-C peripheral by detaro on Sunday November 03, 2019 @08:40AM (#21433812)
Archive.is doesn't like that cloudflare doesn't give them information about the subnet the query came from, so they give a bad reply to cloudflare. (https://news.ycombinator.com/item?id=19828317)
Re:Raspberry Pi 4 as a USB-C peripheral by NicoJuicy on Sunday November 03, 2019 @07:48AM (#21433556)
Fyi: USB-c in the rpi 4 is not standards compliant.

A new revision is underway, a fix is just using dumb cables.

Re:Raspberry Pi 4 as a USB-C peripheral by cesarb on Sunday November 03, 2019 @09:48AM (#21434146)
Using dumb cables avoids one of the issues (configuration channel pins shorted together), but not the other one (sourcing power even when the configuration channel says it shouldn't source power).

That is, the workaround is both "use only dumb cables (which use only one of the CC pins)" and "never connect to a USB-C device which might source power while the rpi is being powered by something other than the USB-C".

Re:Raspberry Pi 4 as a USB-C peripheral by xg15 on Sunday November 03, 2019 @05:31PM (#21437186)
> "never connect to a USB-C device which might source power while the rpi is being powered by something other than the USB-C"

Wouldn't this actually apply to a lot of use-cases of the project in the linked blog?

The whole point is connecting the RPi as a peripheral of a laptop, i.e. a power-sourcing host. if you do that, you'll also likely be tempted to use an external power supply for the Pi as the USB's supply is limited. It's important to note that this will lead to problems.

Re:Raspberry Pi 4 as a USB-C peripheral by shinwn on Saturday November 02, 2019 @06:14PM (#21430474)
Is there anything like this that can act as gadget devices for more than one host? (So I can plug it in to 4 different PCs or the like)
Re:Raspberry Pi 4 as a USB-C peripheral by lhoff on Saturday November 02, 2019 @05:52PM (#21430362)
I fail to imagine a usw case for that. Could someone enlighten me?
Re:Raspberry Pi 4 as a USB-C peripheral by mmastrac on Saturday November 02, 2019 @05:59PM (#21430411)
... build a smart boot device that provides a bunch of different CD images for BIOSes that don't do USB boot well

... build a safe password keeper that looks like a HID device

... do something interesting with USB-based gamepads to map those to keyboard keys for playing old DOS games

... make a connected USB storage device that offers some sort of additional sync services for the data stored on it (maybe over wifi?)

... make a network adapter that also acts as a firewall, or possibly links to tor/vpn/etc

... Something something MIDI over USB

Re:Raspberry Pi 4 as a USB-C peripheral by johnchristopher on Saturday November 02, 2019 @11:58PM (#21432060)
> ... make a connected USB storage device that offers some sort of additional sync services for the data stored on it (maybe over wifi?)

There used to be a KS funded case built around a Pi and an HDD that would act as an external storage when plugged to a USB port and would work as Kodi based media player once booted and connected to an HDMI port.

If anybody knows if this can be done DIY style with minimal cable mess I am all ear :).

edit: ah ! https://geekworm.com/blogs/raspberry-pi/how-to-add-extra-sto...

Re:Raspberry Pi 4 as a USB-C peripheral by swiley on Saturday November 02, 2019 @06:06PM (#21430441)
> ... build a smart boot device that provides a bunch of different CD images for BIOSes that don't do USB boot ...

There’s an Android app for that, it’s one of the biggest things I miss after switching to the iPhone.

Re:Raspberry Pi 4 as a USB-C peripheral by mmastrac on Saturday November 02, 2019 @06:15PM (#21430480)
That's awesome. Do you recall the name?
Re:Raspberry Pi 4 as a USB-C peripheral by nougatbyte on Saturday November 02, 2019 @06:25PM (#21430521)
Re:Raspberry Pi 4 as a USB-C peripheral by ce4 on Saturday November 02, 2019 @07:54PM (#21430972)
The last time i checked it needed gadget kernel driver support and root, a showstopper for me...

Apart from that, great concept: load your 5+ cd images onto your 64+ gb android and be done (win10, ubuntu, debian, grml, kali, bios update cd image, etc) and forget about your usb drive collection...

Re:Raspberry Pi 4 as a USB-C peripheral by swiley on Tuesday November 12, 2019 @07:42AM (#21513572)
I thought modern android required the gadget driver anyway? I’m pretty I was able to use it without root but it was (supposedly) less reliable without it.
Re:Raspberry Pi 4 as a USB-C peripheral by milkmiruku on Sunday November 03, 2019 @10:43AM (#21434497)
Once I didn't have any USB sticks handy and didn't know about DriveDroid, so I used Servers Ultimate to host a TFTP server so I could PXE boot the netboot.xzy image from my phone to my laptop then download+install Arch Linux.

https://play.google.com/store/apps/details?id=com.icecoldapp...

Re:Raspberry Pi 4 as a USB-C peripheral by int_19h on Sunday November 03, 2019 @05:50AM (#21433163)
> build a smart boot device that provides a bunch of different CD images for BIOSes that don't do USB boot well

There are a few of those around.

http://isostick.com/

http://www.zalman.com/contents/products/view.html?no=212

http://iodd.kr/wordpress/product/iodd-2531/

Re:Raspberry Pi 4 as a USB-C peripheral by Fnoord on Saturday November 02, 2019 @06:46PM (#21430646)
Nice examples. I suppose you could hang a Raspberry Pi on your smartphone, and have say a Kali machine on it. Though you can also run Kali on Android.
Re:Raspberry Pi 4 as a USB-C peripheral by Erlich_Bachman on Sunday November 03, 2019 @07:49AM (#21433560)
> ... build a safe password keeper that looks like a HID device

Does anyone know if any such similar devices are already available? Whether based on an RPi or not?

Re:Raspberry Pi 4 as a USB-C peripheral by jagger27 on Saturday November 02, 2019 @06:03PM (#21430433)
So you can add GPIO to your computer with lots of preprocessing power.
Re:Raspberry Pi 4 as a USB-C peripheral by ngcc_hk on Saturday November 02, 2019 @07:49PM (#21430949)
Wow. What a good summary. Should be the heading. :-)
Re:Raspberry Pi 4 as a USB-C peripheral by hardillb on Saturday November 02, 2019 @06:02PM (#21430429)
Say you are a mac user and want a portable Linux environment to play with that has GPIO? (That you can use on a plane)

You want to run a secure off line personal Certificate Authority (a Pi Zero would probably be enough and can work in the same way)

It can also be any other type of USB device, e.g. a HID device (keyboard/mouse/joystick) you can dream up loads of interesting things to do with this

Re:Raspberry Pi 4 as a USB-C peripheral by rcarmo on Saturday November 02, 2019 @06:05PM (#21430440)
I use a 3A+ for this. Works great, uses a lot less power, and is smaller.
Re:Raspberry Pi 4 as a USB-C peripheral by hardillb on Saturday November 02, 2019 @06:08PM (#21430454)
The power draw is better with the new bootloader (lets the whole USB stack drop into low power mode)

Also this is USB-C native for all the mac book folk out there that hate to carry all those adapters

Re:Raspberry Pi 4 as a USB-C peripheral by monocasa on Saturday November 02, 2019 @06:29PM (#21430546)
A debug port for an embedded device that looks like a UART and a MTP mount of the filesystem?
Re:Raspberry Pi 4 as a USB-C peripheral by lawik on Sunday November 03, 2019 @02:16AM (#21432605)
In the Nerves project (Elixir thing for embedded linux) it is used to be able to power, SSH to the device and push new firmware changes without needing to reimage the SD card. Already used that a lot with the zero and 3A.
Re:Raspberry Pi 4 as a USB-C peripheral by ianai on Saturday November 02, 2019 @06:25PM (#21430520)
Part time “HPC”. Lots of bandwidth in usbc and probably just enough compute to use it. Testbedding comes to mind.
Re:Raspberry Pi 4 as a USB-C peripheral by lhoff on Saturday November 02, 2019 @06:34PM (#21430582)
Thanks for the Answers!
Re:Raspberry Pi 4 as a USB-C peripheral by villgax on Sunday November 03, 2019 @05:11AM (#21433066)
Literally converting it into a successful Mac accessory itself is a kickstarter gold!
Re:Raspberry Pi 4 as a USB-C peripheral by fattire on Sunday November 03, 2019 @03:19AM (#21432767)
wonder if this would be a much better hw solution for TeslaUSB...

https://github.com/cimryan/teslausb