Coder Social home page Coder Social logo

Comments (36)

gozillah avatar gozillah commented on July 19, 2024 1

I designed and printed an enclosure for the Zero 2W (without header pins) and the black USB adapter (link):

240129_Boxnexitf

DSCN26snexif

DSCN27snexif

It is easy to print and (re-)uses all parts of the adapter (including screws and nuts) minus the acrylic bottom plate (which gave me the z-height to re-use the screws). The MicroSD card is accessible without opening the enclosure.

It is a bit wider than a normal USB connector, so it may obstruct nearby PC ports, but I can't help.

I will supply the CAD source code and the printable .stl file into the public domain.

from torbox.

gozillah avatar gozillah commented on July 19, 2024 1

Improved 3D design: 240208_ZeroUSB.zip

  • New trick to make the slicer route a star around the screw boreholes, making supports inside the screw and nut recesses unnecessary. On my printer I can now completely renounce on supports, even in the USB-A cutout.
  • Aligning four floors of holes during assembly is a bit intricate. I added alignement rails for the USB adapter, so there are now only three initially misaligned floors.

It is designed to enclose a Pi Zero 2W and this specific type of adapter:

adapter1s
The Zero must be flat to fit the enclosure, i.e. without the two rows of GPIO pins. The picture above shows it with GPIO pins.
adapter2st
Of the supplied parts you will need the black PCB with the USB connector, the thick acrylic board with the three big holes mounted in between PCB and Zero, the four screws and the four nuts to hold everything together. The thin acrylic board is not required.

To make the Zero's green LED more visible you may insert a short piece of transparent filament into the LED peephole as a sort of a light guide.

from torbox.

gozillah avatar gozillah commented on July 19, 2024 1

I have been testing 32bit Bookworm Torbox053 mini on Pi Zero 2W via USB to Windows 10 and MacOS Monterey for quite a while now. It worked very reliably. Connecting it to Android and iOS is still uncharted however.

Do you intend to include TorBox mini in the next release image or as a separate image?

How could I help? My core area being 3D design rather than Pi and networking: Would it make sense that I scripted instructions about where to purchase the USB adapter, howto 3D print and assemble a compact enclosure and configure Windows and MacOS?

Additionally I designed a compact and mature 3D printable enclosure for an autonomous TorBox WiFi access point based on Pi Zero 2W, second WiFi interface and Li-ion battery for 2 hours of stand-alone operation, using commercial off-the-shelf components (with the exception of the enclosure). It will be important for this configuration to maintain the loading of the various WiFi drivers as part of the new release.

from torbox.

gozillah avatar gozillah commented on July 19, 2024

I am one step further: I installed https://github.com/bablokb/raspi2go (see "Listing 2" in https://www.raspberry-pi-geek.de/ausgaben/rpg/2020/04/pi-zero-als-universeller-usb-stick/2/) on my Pi Zero 2W / Torbox 042. Having connected the Pi's USB port to the USB port of my MacBook I can now login over USB with "ssh [email protected]". Then in the main Torbox menu I selected option 7 (Internet access via the built-in wlan0) and sucessfully connected wlan0 to the external WiFi access point. In the next menu Tor access was not confirmed, but this evaluation is not absolutely trustworthy according to my earlier experience. Back in the main menu, the leftarrow to the right of option 7 confirmed the wlan0 connection. However, even after having waited for several minutes, there was no connection to the Tor network. So far I have not been sucessful applying above steps on Windows 10. Any help is appreciated.

from torbox.

gozillah avatar gozillah commented on July 19, 2024

Unfortunately this issue starts to be a monologue. No one has mercy. Begging seems useless. Never mind, let's move on.

I have now progressed on Windows 10 as far as I have been with my MacBook. First I had to install a Remote NDIS (RNDIS) driver for Windows 10 to make Windows believe that my USB connection to the Pi Zero is an Ethernet connection. I found step 8 and following of this website helpful: https://www.factoryforward.com/pi-zero-w-headless-setup-windows10-rndis-driver-issue-resolved/ . Or I could simply have install the driver from https://www.factoryforward.com/wp-content/uploads/2018/01/mod-duo-rndis.zip . USB does not support the TorBox IP addressing scheme (192.168.42.1). I had to download and install Bonjour from https://support.apple.com/kb/DL999 to enable my Windows SSH utility Putty (https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) to find the Pi Zero under the login@hostname address of "[email protected]".

I am currently able to configure TorBox from both MacBook and Windows. According to my intuition I should then continue by terminating the SSH connection, followed by automatic tethering of the PC to the Pi Zero via USB, similarly to tethering a mobile to a PC for mobile data access. The Pi Zero would then route any and all USB traffic to and from Tor. Resuming TorBox configuration would require rebooting the Pi Zero. At present I do not have the faintest idea how to achieve this.

from torbox.

radio24 avatar radio24 commented on July 19, 2024

1 - Compatibility with Raspberry Pi 3B (Version 1.2)
To test the possible compatibility and performance issues of the TorBox on a Raspberry Pi 3B (Version 1.2), I flashed the current TorBox v.0.5.3 (17.12.2023) on a SD Card and started the Pi with an additional compatible USB WiFi dongle:

Raspberry Pi 3B (Version 1.2)

The first boot process will take up to 5 minutes because the image will self-expand over the entire SD Card and reboot the Pi. Also, my impression is that the process is slower than on a Raspberry Pi 4, but it doesn't show any issues with the 64-bit Raspberry Pi OS as the base system. When the boot process is finished, the WP "torbox053" is clearly visible on a client device. Connecting with a web browser and a SSH client on 192.168.42.1 works flawlessly, as the first start-up procedure does. The only difference may be the reduced speed; however, I had a max throughput of 2MB.

I will monitor the real-world use of the TorBox on this Raspberry Pi with a client in the next few hours and report back. So far, all works as expected.

from torbox.

radio24 avatar radio24 commented on July 19, 2024

2 - Making TorBox smaller and stealthier
I had the same thought when I first attempted the "TorBox mini" project 2,5 years ago. I used this article as a starting point. However, somehow it never worked for me. If I remember correctly, I never succeeded in seeing the Pi Zero W USB dongle as a network device on my Mac. However, as usual, I was under time pressure and postponed the entire project ... until now. 🙄

Raspberry Pi 3B (Version 1.2)

I guess, running on a Pi Zero W/2 W, TorBox should see the Internet on wlan0 and the client on usb0 (this is also the way to access the TorBox menu by a web browser or a SSH client - in fact, we have only two logical channels, not three). To look out for the Internet on wlan0 is not yet supported by TorBox. That is why it will not work in your configuration. It may be a weekend job to integrate this kind of support. I will add the necessary support if you confirm that the interface names on your tested Pi Zero W/2 W are wlan0 and ubs0. However, there is another catch: in the photo above are the two solderless adapters I used to transform the Pi Zero WS to "zero dongles." Both adapters have been sold out for months, and there seems to be no solderless solution for the Pi Zero 2 W. The best solution may be to use an adapter, as seen here. These questions must be addressed because without an easy and reliable way to get the thing working, people will not use such a device, and therefore, it wouldn't be worth investing the time to make all the changes in the code.

About your thoughts:

  • Not autonomously activate its WiFi access point: possible - this is a point I still have to address with the TorBox on a Cloud configuration. A flag can handle it in the torbox.run file, which will be checked during the boot process.
  • About the tethering connection: if the Pi Zero W USB dongle is treated as a network device, meaning TCP/IP is used to route the data packages from the client over the USB port to the Pi, which uses iptables to route the packages via wlan0 to the tor network, then I don't see any issues. It is not different from the default configuration, and data, as well as SSH connection to the device, can be used at the same time. However, the Pi is to be identified as a network device - this is the crucial point ... and it cannot be complicated for the user; otherwise, nobody will use it.
  • Regarding the used hardware and the type of Raspberry Pi OS: today, the base should be a Pi Zero 2 W because it is up to five times as fast as the original Pi Zero and supports the 64-bit version of the Raspberry Pi OS.
  • About creating a pre-configured Raspberry Pi OS image for the Pi Zero 2 W: the Raspberry Pi Imager should also support this: https://www.raspberrypi.com/documentation/computers/getting-started.html#raspberry-pi-imager
  • About TorBox's address scheme: to separate different kinds of "modes" but integrate them in one configuration, we have to use 192.168.45.x for the Pi.

Conclusion
I'm convinced that if the plugged Pi Zero 2 W acts as a network device on a client machine, the necessary adaption of TorBox can be done on a weekend and will work. In the last few months, I did a similar task with TorBox on a cloud. To me, the following information is crucial before I invest my time in it again: the interface names on an ordinary Pi Zero 2 W dongle (wlan0/usb0?) and the easy way to build for people who will use such a device.

from torbox.

gozillah avatar gozillah commented on July 19, 2024

I am very happy to see this issue being pushed forward, thank you!

I confirm that the interface names on my Pi Zero 2W are usb0 and wlan0:

torbox@TorBox042:~/torbox $ ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
...
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
...
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
...

Pi Zero, Pi Zero W and Pi Zero 2W have the same Pogopin access points (Vcc, GND, D+, D-) at the same locations on their underside.

The solderless USB-A adapter is available here:
https://geekworm.com/collections/raspberry-pi/Expansion-Board+Raspberry-Pi-zero
https://www.aliexpress.com/item/1005004988260923.html
https://www.aliexpress.com/item/1005003778463582.html
However this model requires inserting the Pi Zero upside down, jacking e.g. a MacBook Air up.

This one has the Pi Zero on the upper side, avoiding the problem:
https://www.aliexpress.com/item/1005003660807048.html
https://www.aliexpress.com/item/32846959589.html
https://www.aliexpress.com/item/32956403469.html
https://www.aliexpress.com/item/1005003049906551.html

Here is yet another solderless solution:
https://www.tindie.com/products/8086net/solderless-zero-dongle-for-raspberry-pi-zero/
https://www.tindie.com/products/8086net/solderless-zero-micro-dongle-for-raspberry-pi-zero/

For a notebook a simple Micro-USB male to USB-A male cable from the Pi Zero's Micro-USB female data port to the notebook's USB-A female connector has the same effect electrically:
https://www.aliexpress.com/item/1005005842324335.html
The white official Raspberry Pi OTG Micro-USB male to USB-A female cable would require another cable with two USB-A male connectors.

Connecting a (up-to-date) mobile would require a USB-C male to Micro-USB male cable, e.g. this one:
https://www.aliexpress.com/item/1005005602525557.html
This Android app
https://play.google.com/store/apps/details?id=org.connectbot&hl=en&gl=US
is working well for TorBox SSH access.

I will be happy to test your prototype images on Pi Zero 2W with MacBook Air (Monterey), Windows 10 and Android.

This is my well-performing Pi Zero 2W with TorBox 042, WiFi dongle for wlan1 and Waveshare Li-ion supply (underneath) in a 3D-printed case with cover. Plus my Pi Zero W with the upside-down USB-A adapter:

DSCN5210hnoexif

from torbox.

radio24 avatar radio24 commented on July 19, 2024

Thank you very much for the detailed information. I just ordered a Pi Zero 2W and will work on the project, but I must warn you that I might need some time because of my workload from other projects.

However, first things first, with your research, preparative work, and detailed feedback, you already earned a ProtonMail $100 Gift Card from our "feedback-giveaway" program. Please send a message to the TorBox email as soon as possible, and for verification, the original date, size, and SHA256 value of the file menu in the TorBox version you use on your Pi Zero 2 W.

from torbox.

radio24 avatar radio24 commented on July 19, 2024

What is your procedure for creating the Pi Zero W / 2 W USB-gadget?

  • Creating a Raspberry Pi SD Card with configured WiFi AP and SSH server
  • Booting up the Pi Zero W / 2 W with the prepared SD Card
  • SSH into the Pi Zero W / 2 W
  • Download and run the raspi2go tool on the Pi Zero W / 2 W (is this tool really necessary? Doesn't modules-load=dwc2,g_ether be enough - see also here)?
  • Access from the Mac via the USB port (without installing or configuring something on the Mac?)

from torbox.

gozillah avatar gozillah commented on July 19, 2024

I installed a standard Torbox 042 image on a MicroSD and booted my Zero 2W with it.

TorBox 042 in its standard configuration after installation and boot does not accept SSH through the Pi's usb0 yet. In the Internet I found a lot of websites explaining the two extensions to config.txt (dtoverlay=dwc2) and cmdline.txt (modules-load=dwc2,g_ether) in order to (allegedly) be able to SSH through the Pi's USB port, but that alone did not work in my case.

Only after I found and installed raspi2go I could SSH into Torbox 042 without problems from my MacBook Air 2015 with MacOS 12.7.2 Monterey, Linux terminal app, "ssh [email protected]" (192.168.42.1 will not work). That's because MacOS supports Bonjour which - on the Mac - associates the TorBox's IP address to its hostname. May be raspi2go was somewhow cooking the Pi's IP address and hostname for Bonjour. I haven't studied yet what raspi2go actually does.

I cannot remember having installed anything particular on my MacBook for TorBox042. I think Bonjour ist just part of Monterey.

Windows does not support Bonjour by default, but it is easily installed from an Internet download. However this was not enough. Per default Windows sees the Pi as a serial device, see at the top of the device manager. In this configuration Windows does not seem to be able to handle network adressing (IP or hostname). It is therefore necessary to install an RNDIS driver which somehow bends Windows' Ethernet-centric networking view into the USB port and disconnects the serial device driver from the USB port. Again there were many RNDIS download sites which did not porvide a working RNDIS. I recommend the link in my comment above. At that point I could access the Pi via Putty just as I did with the MacBook and the Linux terminal app.

Android supports "Service discovery" which is Google's naming of Bonjour (Bonjour = Apple trade name). I tried several SSH apps and found the ConnectBot functional. They all can SSH-connect, but for TorBox I need a 24x80 Terminal emulation, an Esc key and some cursor keys, which ConnectBot provides. I run a Samsung S21 Ultra with Android 14.

I still haven't tried TorBox 042 on the Zero W yet. TorBox CPU load on the 2W is minimal, so a Zero W may be way enough for TorBox.

TorBox 053 did not work on the Zero 2W: Under TorBox 053 I can connect to the Zero 2W's access point (Windows Putty [email protected] or MacBook [email protected]) but Putty or the MacBook Linux terminal will show me an empty screen. I feel that you will have to maintain a Torbox05x 32bit image for the Zero W / 2W family.

Looking forward to your prototypes I am currently designing ever better enclosures for my Zero 2W + Waveshare UPS HAT + wlan1 dongle standalone Tor accesspoint. The tiny 1'000 mAh Li-ion battery of the Waveshare UPS HAT supplies this TorBox 042 access point for hours.

from torbox.

gozillah avatar gozillah commented on July 19, 2024

Perhaps a heretical thought: Why bother about 64bit? The computing load on a TorBox is so low that 32bit is way enough.

from torbox.

radio24 avatar radio24 commented on July 19, 2024

Ok 🤔

Let me explain what I am trying to do... Before starting any TorBox version, I will run a plain vanilla Raspberry Pi OS (32-bit light on a Raspberry Pi Zero W).

Attempt 1: I'm using the Raspberry Pi Imager with the customization option (see here under "OS customization"). Then I start the Raspberry Pi Zero W up, which seems to work according to the green LED, but it doesn't create a wifi AP that I can log into. I couldn't find a reason why it is not working. Update (26.01.2024): the customization option doesn't create an AP. It connects to an already existing wifi.

Attempt 2: I skipped the wifi part and wanted to access the Raspberry Pi Zero W directly through USB. After flashing the SD Card with Raspberry Pi OS 32-bit light (without customization), I edited the config.txt and the cmdline.txt as described here. Plugging the Raspberry Pi Zero W into the Mac USB port started the Pi up. The Mac identifies the Pi as a RNDIS/Ethernet Gadget. I can even ping the Pi, but I cannot SSH into the Pi. The reason is the missing default user pi. They removed it sometime in the last year(s).

Attempt 3: I combined Attempt 1 and 2 --> creating the user with the Raspberry Pi Imager and manually adding the necessary changes into config.txt and cmdline.txt. SUCCESS! SSH login via Mac is possible.

Result
Opening a fresh flashed SD Card (usually called boot) and copying/replacing these three files (for Bullseye 32-bit / for Bookworm 32-bit) will give you a RNDIS/Ethernet Gadget, plugged into a Mac USB will start up after a while will be identified as a RNDIS/Ethernet Gadget and can be accessed with ssh [email protected] (password: CHANGE-IT). No additional tool needed.

Comment
All the above worked with a Raspberry Pi Zero 2W, but it is noticeably more performant. Therefore, I will now switch to the Raspberry Pi Zero 2W.

Next
Try to install TorBox directly on the Raspberry Pi Zero 2W with the install script. It will be interesting to see how long compiling tor will take.

from torbox.

radio24 avatar radio24 commented on July 19, 2024

I still haven't tried TorBox 042 on the Zero W yet. TorBox CPU load on the 2W is minimal so that a Zero W may be way enough for TorBox.

It may be the case if tor is freshly started. The preliminary findings of my compatibility test (see above) showed that the current tor version runs fine for two days on the Raspberry Pi 3 Model B, but then the entire system slows down and freezes as the system's resources are eaten up.

Why bother about 64bit? The computing load on a TorBox is so low that 32bit is way enough.

First, 32-bit is marked as legacy... better to switch now. On the other spectrum, we have TorBox on a cloud. There are Cloud providers that don't offer 32-bit OS anymore. Maintaining several TorBox variants is too time-intensive for me (it is not my job; I don't even earn my money in IT) - the goal is to have one system, possibly one image, to catch the most.

from torbox.

radio24 avatar radio24 commented on July 19, 2024

Could you refresh your browser before commenting? You are referring to an old (first) version of my comment. My last update was made 8 hours ago. There, you will see some substantial progress.

To start with, TorBox 0.4.2 is not an option because I have to understand the fundamentals to integrate it into the latest version of TorBox, which has substantial fixes regarding older versions. With the „latest version”, I don‘t mean the image. More important are the installation scripts because with these scripts, you can also compile a 32-bit version of TorBox.

from torbox.

gozillah avatar gozillah commented on July 19, 2024

I deleted two of my comments. I was a bit out of sync with your comments, sorry.

from torbox.

gozillah avatar gozillah commented on July 19, 2024

Could you refresh your browser before commenting? You are referring to an old (first) version of my comment. My last update was made 8 hours ago. There, you will see some substantial progress.

To start with, TorBox 0.4.2 is not an option because I have to understand the fundamentals to integrate it into the latest version of TorBox, which has substantial fixes regarding older versions. With the „latest version”, I don‘t mean the image. More important are the installation scripts because with these scripts, you can also compile a 32-bit version of TorBox.

Ok, now I understand. I was worried about 64bit-only because I was unable to run 053 on Zero 2W. Currently my only option is 042.

I tried to USB-connect Zero 2W / TorBox 042 to Android 14 and SSH via the ConnectBot app, so far not yet successfully. There are several options: OTG or straight cable and various USB connection modes (MTP, PTP, USB tethering, MIDI, battery charging only, VPN). ConnectBot does neither connect to 192.168.42.1 nor TorBox042.local nor TorBox042 host name. The avahi daemon is installed on the Zero's image and running but Android does not detect its messages at the USB port, maybe due to incompatible USB protocol, permission problems or missing Android app for service discovery (https://developer.android.com/develop/connectivity/wifi/use-nsd#java). I am currently assuming that the problem is on the Android side because TorBox is working with MacOS and Windows. I will do some Internet research tonight.

from torbox.

gozillah avatar gozillah commented on July 19, 2024

A possible solution for Android may be "reverse USB tethering": In normal USB tethering, the mobile is the modem and the PC is the client using the mobile's Internet access via USB. Our architecture is the exact reverse: The mobile is the client and TorBox is the modem providing Internet access to the client.

Whereas Android has a built-in standard interface for normal USB tethering, there is no such OS support for reverse USB tethering. In a Android + TorBox environment we may therefore need

  1. A reverse USB tethering Android app, implementing a relay between (a) any Android app's (e.g. browser) network access (implemented by this reverse USB tethering Android app as an Android-internal interface to which unmodified standard apps are able to connect) and (b) across USB to the reverse USB tethering server in the TorBox.

  2. A reverse USB tethering server in the TorBox.

There are a "re-Link" and a "Reverse Tethering NoRoot" app in Google Playstore, together with downloadable Windows/MacOS/Linux server applications. Using a closed-source application may not be acceptable for our purpose, but there are open-source reverse tethering apps in Github Link. While we could provide the server application as part of the TorBox release (i.e. invisible to the user), the user will have to install a TorBox app of some sort on his Android, and we will have to provide and maintain it for a range of Android versions. I am not yet talking about iOS (which I am not familiar with). Windows and MacOS differ in that there are easy to install standard SW packages available (RNDIS driver, Bonjour).

This is going to be complex, but I (currently) don't see an alternative among the available Android USB interfaces. I wish I was wrong. I therefore suggest that we drop Android support from our todo-list, at least for the initial release or until we discover a simpler solution.

Apropos Bonjour: Rumors qualify it as not particularly secure. One issue seems to be that hostnames are not authenticated. I do not know whether it would be possible to inject a spoofed hostname ("TorBox.local") via the external WiFi AP such that the client may directly connect to it instead of to the TorBox entry point, or whether the TorBox entry point and the WiFi AP are sufficiently isolated from the perspective of Bonjour.

Apropos RNDIS: I read here Link that "RNDIS linux module is being deprecated and will be removed from the Linux Kernel in favor Network Control Model (NCM), but it is used by majority of devices nowadays (2023) and up to now the only way to configure working USB tethering for old Android devices."

from torbox.

gozillah avatar gozillah commented on July 19, 2024

I am running TorBox042 on my dual-wlan Zero 2W without problems (apart from Torbox042 being obsolete).

Torbox053 isn't working on Zero 2W. I therefore wanted to script-install Torbox053 on 32bit Bookworm:

  • I installed 32bit Pi OS light (2023-12-11-raspios-bookworm-armhf-lite.img.xz, 544.9 MB on my Mac) from link on a MicroSD, put it into my Zero 2W, booted and connected headless via SSH and router.

I then proceeded according to link and footnote 1:

  • Time was ok
  • Updated and upgraded Bookworm
  • wget was already included
  • ./run_install_on_debian.sh . link says run it as root, but ./run_install_on_debian.sh welcome screen says don't run it as sudo. Root is not installed, running it as user leads to unwriteable lockfiles, so I chose sudo.
  • The installation takes hours and stalls at

...
Collecting h11<1,>=0.9.0
Downloading https://www.piwheels.org/simple/h11/h11-0.14.0-py3-none-any.whl (58 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.3/58.3 kB 492.6 kB/s eta 0:00:00
Building wheels for collected packages: opencv-python-headless
Building wheel for opencv-python-headless (pyproject.toml) ... -

Here the spinner turned about once in minutes, the 0.5 GB RAM did not seem to be full, but swap was non-zero. I therefore tried the same on my newly acquired Pi 5 / 8GB. There the exact same happened, only a bit faster. It stalled at the exact same spot.

What was wrong? How can I script-install an up-to-date Torbox053 on 32bit Bookworm?

from torbox.

radio24 avatar radio24 commented on July 19, 2024

Let's do it together...

I have a Raspberry Pi Zero 2 W here. On the SD Card is a Raspberry Pi OS (Legacy, Bullseye) lite 32-bit with these three files. I plug the Pi into one of my Mac's USB ports and let the Pi start up. The Mac recognizes a RNDIS/Ethernet Gadget and gives it a local IP address. I log into the Pi with ssh [email protected] (password: CHANGE-IT).

Next, I have to connect to my wifi. I use on the Pi the following commands:

  • sudo rfkill unblock wlan
  • sudo systemctl stop wpa_supplicant
  • sudo systemctl stop NetworkManager
  • sudo ip link set dev wlan0 up
  • Find wireless networks and note down the name (SSID): sudo iw wlan0 scan | grep SSID:
  • Build the wpa_supplicant.conf ( is the name of the wireless network to connect, the password of ): sudo wpa_passphrase <SSID> <wifi-password> | sudo tee -a /etc/wpa_supplicant/wpa_supplicant.conf
  • Connect to the wireless network: sudo wpa_supplicant -B -c /etc/wpa_supplicant/wpa_supplicant.conf -i wlan0
  • If needed: start dhclient to get an IP: sudo dhclient wlan0

You may get error messages by connecting to the wireless network. If you get an IP address at the end of the process, then just ignore it.

Now, let's install TorBox:

cd
wget https://raw.githubusercontent.com/radio24/TorBox/master/install/run_install.sh
chmod a+x run_install.sh  
./run_install.sh --step_by_step

Some remarks on your posting above

  • You have to run run_install.sh on Raspberry Pi OS. run_install_on_debian.sh is for Debian only. On Debian, the user is logged in as root. Therefore, the script doesn't use sudo internally. Using sudo ./run_install_on_debian.sh on Debian will lead to error messages. In your case, you could invoke the command without error messages. However, because there are differences between run_install.sh and run_install_on_debian.sh, your system will finally not work correctly.
  • I had the same problem with installing opencv-python-headless -- I didn't find the cause, but I fixed it. The updated script installs the package via apt-get instead of using pip. Opencv is used to solve the captcha when asking the tor bridge database for bridges. Installing the Python modules should be done in about 30 minutes.
  • I guess the biggest job for the Raspberry Pi Zero 2 W is to compile tor. It takes about one hour to do that.
  • If it's of interest to you, I haven't used any additional power for the Raspberry Pi Zero 2 W. I use only the power it gets from the Mac USB port.

References

Next

  • I will try the same again, but this time with Raspberry Pi OS (Bookworm) lite 64-bit on a Raspberry Pi Zero 2 W. If this is also successful, I will modify TorBox for the Raspberry Pi Zero 2 W. Update: There are some hiccups with Bookworm --> see here and here.
  • There is also an open question: How does the RNDIS/Ethernet Gadget work under a standard Linux installation like Debian, Ubuntu, Manjaro, etc.? Do these systems automatically identify the Raspberry Pi Zero 2 W if plugged into a USB port?

Update
The installation went well, but the RNDIS/Ethernet Gadget no longer worked after restarting the Pi. That's not what we want, and we must isolate the problem.

from torbox.

radio24 avatar radio24 commented on July 19, 2024

Raspberry Pi OS (Bookworm) lite 64-bit is a troublemaker!
I got into serious troubles with Raspberry Pi OS (Bookworm) lite 64-bit on a Raspberry Pi Zero 2 W. It seems it doesn't boot up correctly. After a successful boot, the file firstrun.sh should have been deleted, which was not the case. I cannot confirm it because I don't yet have an HDMI-mini to HDMI adapter.

Interestingly, the 32-bit version seems to work fine. I guess I have to rethink my stand on the 32-bit version... Anyway, it doesn't matter because the final installation script for the Raspberry Pi Zero 2 W and TorBox should run on the 32-bit and 64-bit of the actual version of the Raspberry Pi OS.

Nevertheless, why do we see these problems when the Raspberry Pi Zero 2 W has a quad-core 64-bit ARM Cortex-A53? There could be two reasons - too much power consumption (unlikely because adding an external power source doesn't change the situation, or the lack of SDRAM (512 MB). Anyway, another user experienced similar problems with the 64-bit version: "Switching back to 32-bit Raspberry Pi OS for RPI Zero 2W resolved freeze and unresponsive issue I have been having with the device."

First test with run_install_mini.sh
The first test-run of run_install.sh and the fact that the usb0 on the Pi can be used as an interface to the Internet (USB dongle or Tethering with Android) or to the client (RNDIS/Ethernet Gadget), I decided to create a separate installation script (run_install_mini.sh) for the TorBox-mini project.

Installation on a Raspberry Pi Zero 2 W
Steps to test the run_install_mini.sh:

  • Create a SD Card with Raspberry Pi OS (Bookworm) lite 32-bit.
  • Copy/replace these three files.
  • Plug the Pi into one of my Mac's USB ports and let the Pi start up. The Mac recognizes a RNDIS/Ethernet Gadget and gives it a local IP address. I log into the Pi with ssh [email protected] (password: CHANGE-IT).
  • Connect the Raspberry Pi Zero 2 W to the wifi (see here)
  • Install TorBox with the following commands:
cd
wget https://raw.githubusercontent.com/radio24/TorBox/torbox_mini/install/run_install_mini.sh
chmod a+x run_install_mini.sh  
./run_install_mini.sh --select-branch torbox_mini

Post-Installation
To ensure the RNDIS/Ethernet Gadget is recognized, please pull the Pi and plug it again into the USB. Unfortunately, for unknown reasons, my Mac doesn't always accept the delivered IPv4 from the DHCP server on the Pi. Eventually, you can log into the Pi with ssh [email protected] (password: CHANGE-IT) because of the activated IPv6 (if the RNDIS/Ethernet Gadget interface on the Mac is set to DHCP). However, before using the Pi as a TorBox routing the data traffic through tor, you have to manually put the following information in the client's network configuration for the RNDIS/Ethernet Gadget (iptables on the pi needs these information):

IP: 192.168.44.2
Subnet: 255.255.255.0
Router/Gateway: 192.168.44.1
DNS: 192.168.44.1

192.168.44.1 is the IP address of the Pi; 192.168.44.2 is the IP address of the Client. For the DNS, it is also possible to use any other DNS IP like 1.1.1.1 or 8.8.8.8.

Surprisingly, after putting this information into the client's network configuration for the RNDIS/Ethernet Gadget and switching back to DHCP, the RNDIS/Ethernet Gadget interface on the Mac suddenly accepted the served IP address. In this case, you can log into the Pi with ssh [email protected] or ssh [email protected]. This behavior is something we have to check.

The First Start-up Dialogue pops up during the first login. Asking where the Internet is coming from, I chose entry 3 (Wireless network through the onboard chip). Following that, and at the end of the First Start-up Dialogue, tor is starting. No additional network drivers have to be installed -- skip that one.

After the First Start-up Dialogue and back in the main menu, I disabled all other network connections on my Mac and checked the connectivity with https://check.torproject.org/ --> SUCCESS!

Your input is requested
If you follow the installation guide, you should end with a working "TorBox mini". All data from the Mac will be sent to the Pi's usb0, then routed via wlan0 to the Tor network. However, the implementation is still in its beginning. I will make a to-do list further down. It is important to me to have your input on what is needed to have, nice to have, or not required on the "TorBox mini". For example, support for a wifi access point on the Pi is not needed; we don't need an additional network driver, and most probably not all connection possibilities in the main menu.

Because of my day job, I cannot work on the project for the following weeks. However, I expect you to test the current status and give me input for the to-do list.

from torbox.

gozillah avatar gozillah commented on July 19, 2024

I had the same trouble with 64bit TorBox053 on Zero 2W. My Waveshare "UPS HAT C" (Link) is said to deliver up to 1.8 amps (Link, look for "Question: What is the output current?"). The UPS HAT has an I2C interface through which I can measure the actual supply current. Torbox042 on Zero 2W has an idle power consumption of about 0.35 amps, with observed maximums of about twice this value (but I cannot measure peak glitches). 0.7 amps may be too much for MAC's USB 2.0 max. 0.5 amp. You may connect a Pi 3B power supply to the "PWR" MicroUSB of the Zero 2W.

ADDENDUM:

I performed more extensive and better defined measurements with the following setup:

  • Headless Zero 2W with TorBox042, all CPUs enabled, HDMI not (?) switched off
  • Configured as Tor access point (wlan0) to Internet (wlan1 USB dongle)
  • Powered by Waveshare UPS HAT C
  • Running youtube.com at 1080p resolution (performing like an ace)
  • Measurements taken once per second from UPS HAT I2C interface (modified Python3 application from link)

Peak current observed was 579 mA, typical current was between 300 and 400 mA, CPU temperature 45 C (no heatsink). During another measurement series the peak current was 509 mA.

Conclusion: Given that the target configuration would lack the wlan1 USB dongle, HDMI could be switched of and CPU count could be reduced to one, USB 2.0 @ 500 mA may be sufficient.

Uff, relief!

ADDENDUM No.2:

Additionally, I measured the supply current with my QWAY U2 (link) inserted between my MacBook's USB-A and (via USB cable) the Zero 2W's MicroUSB PWR connector, with the Wireshare UPS HAT C being switched off. Otherwise same setup including TorBox042 and wlan1 USB dongle. With (and without) youtube.com at 1080p the current consumption was about 320 mA. The data rate does not seem to influence power consumption. However with the client (via wlan0) disconnected from the TorBox access point the current consumption dropped to some 220 mA. The QWAY U2 is taking about four measurements per second, so again I am not able to see power glitches.

from torbox.

gozillah avatar gozillah commented on July 19, 2024

In the latest Raspberry Pi Imager v1.8.5, when selecting a Pi type (..., Zero, Zero 2W, Pi 3, Pi 4, Pi 5), Bookworm is exclusively selectable for Pi 4 and Pi 5, with the 64bit version proposed and the 32bit version as an option. Bullseye 32bit is proposed for Pi 3 and lower. Bullseye 64bit is an option for Zero 2W and Pi 3 only.

from torbox.

radio24 avatar radio24 commented on July 19, 2024

In the latest Raspberry Pi Imager v1.8.5, when selecting a Pi type (..., Zero, Zero 2W, Pi 3, Pi 4, Pi 5), Bookworm is exclusively selectable for Pi 4 and Pi 5, with the 64bit version proposed and the 32bit version as an option. Bullseye 32bit is proposed for Pi 3 and lower. Bullseye 64bit is an option for Zero 2W and Pi 3 only.

Raspberry Pi OS (Bookworm) lite 32-bit on a Raspberry Pi Zero 2 W works without problem.

from torbox.

radio24 avatar radio24 commented on July 19, 2024

Please see the project's updated status here. If you follow the installation guide, you should end with a working "TorBox mini". At least, for me, it worked.

from torbox.

gozillah avatar gozillah commented on July 19, 2024

I just built your Bookworm 32bit Torbox-mini on my Zero 2W in about 2h30!

There were a couple of warnings flashing by. It would probably make sense to remove the "Clear" commands in the install script to be able to save the full installation minutes for later analysis.

I configured the RNDIS/Ethernet Gadget in my MacBook according to your instructions. I did this during the building process. At that time my browser on the MacBook was no longer able to access the Internet through MacBook's WiFi. I have no explanation for this. In the "Network" setup utility of the Mac both WiFi and RNDIS were marked as active (green "LED").

After completion of the buid I rebootet and it actually worked !!! Absolutely great !!!

Then I ran through the initial setup process. At the completion of the
[+] DONE! Checking progress - please be patient!
section (100% Done) I was not able to leave via Ctrl-C (as usual) or ESC and had to reboot again.

Nota bene: The "100% Done" message is sometimes (but not alwys) displayed in light grey (hardly visible), also in TorBox042.

After reboot I was asked whether to update the WiFi drivers. At first sight this may not make sense in the context of a separate USB dongle image. However if a user wanted to use a special USB transmitter, e.g. with an antenna socket or with higher power, then he could implement this even with a Zero 2W and updating the drivers would make sense. This would also justify to keep the wlan1 configuration option in this image.

After having selected the external access point and restarting Tor, I got this
HMMM... THAT DOESN'T LOOK GOOD...
as always. Never mind, it is always fake news.

Connecting to check.torproject.org gave me the green variant of the possible answers!

I see two usecases for Torbox-mini:

  1. The Zero 2W USB dongle as a super-portable, surreptitious, (relatively) easy to use Tor access for a single user. Lacking an access point it has a relatively low electro-magnetic footprint in the close environment.

  2. The Zero 2W with additional WiFi adapter and optionally self-sufficient supply (my Waveshare UPS HAT C powers such a combination for more than 2 hours). It is providing a super-portable Tor access point potentially for several concurrent users. It may be operated in a self-sufficient manner at a distance from the actual users. Due to its low cost of about USD 50 (Zero, wlan1, UPS) it may be left behind if necessary.

from torbox.

gozillah avatar gozillah commented on July 19, 2024

I successfully connected Windows 10 via TorBox mini to check.torproject.org (only once, see below).
Let me remember what I did:

  • I installed the RNDIS/Ethernet driver from link
  • I installed Bonjour from link
  • I connected TorBox mini to an USB port of my Windows 10 computer, whereupon Windows detected a new, unidentified network without Internet access
  • I was then able to access the Torbox mini console through Putty / ssh [email protected] and configured wlan0 to the external Internet access point. Strikingly it took Putty severeal seconds to open the terminal window.
  • Trying to connect to the new network, I opened the Windows Ethernet network settings where I observed the built-in "real" Ethernet network of my computer as well as the new network
  • Opening the new network settings I disabled DHCP and manually entered the IPV4 network params (IPV6 off)
  • In this network adapter's properties I allowed others to share this "Ethernet" connection and activated all services (1700 ff, any one really used for Internet access?)
  • In the extended options I entered the network address 192.168.44.1 (you could also do it in the device manager, RNDIS/Ethernet Gadget extended driver options)

Unfortunately I was unable to repeat this success ...

from torbox.

gozillah avatar gozillah commented on July 19, 2024

Maybe I committed a fallacy: It is not our intention to give the Zero access to the Windows PC's Internet connection, but to give the Windows PC access to the Zero's Internet connection (= tethering via RNDIS/Ethernet).

from torbox.

gozillah avatar gozillah commented on July 19, 2024

I further refined the enclosure (LED peephole, assembly cams at the corners):

240202_ZeroUSBnexif

The screw holes are square to make the slicer route squarely instead of round, which gives better results.

Here is the 3D-printable file in case you want to give it a try: 240202_ZeroUSB.zip

You may need supports (gray) in the USB-A connector cutout and the four nut cutouts, see below.

slicer3nexif

from torbox.

gozillah avatar gozillah commented on July 19, 2024

I successfully connected Windows 10 via TorBox mini to check.torproject.org (only once, see below). Let me remember what I did:

* I installed the RNDIS/Ethernet driver from [link](https://modclouddownloadprod.blob.core.windows.net/shared/mod-duo-rndis.zip)

* I installed Bonjour from [link](https://support.apple.com/kb/DL999?locale=en_GB)

* I connected TorBox mini to an USB port of my Windows 10 computer, whereupon Windows detected a new, unidentified network without Internet access

* I was then able to access the Torbox mini console through Putty / ssh [[email protected]](mailto:[email protected]) and configured wlan0 to the external Internet access point. Strikingly it took Putty severeal seconds to open the terminal window.

* Trying to connect to the new network, I opened the Windows Ethernet network settings where I observed the built-in "real" Ethernet network of my computer as well as the new network

* Opening the new network settings I disabled DHCP and manually entered the IPV4 network params (IPV6 off)

* In this network adapter's properties I allowed others to share this "Ethernet" connection and activated all services (1700 ff, any one really used for Internet access?)

* In the extended options I entered the network address 192.168.44.1 (you could also do it in the device manager, RNDIS/Ethernet Gadget extended driver options)

Unfortunately I was unable to repeat this success ...

I finally managed to access the Internet from my Windows PC via my USB-connected TorBox mini and its wlan0 to my private router: In Windows' firewall settings (Settings\System and Security\Windows Defender Firewall\Authorized Apps) I had to allow Windows' Bonjour service access to public networks. Windows seems to categorize TorBox as a public network. However the consequences of this adjustment in terms of security are not entirely clear to me ...

In Putty I still have to access TorBox mini's console by its IP address "[email protected]". "[email protected]" does not work.

from torbox.

radio24 avatar radio24 commented on July 19, 2024

Finally, I'm back again from my break - at least I should be during the Easter weekend. :-)
Sorry for the break, but I had to concentrate on my regular day job.

Anyway, I integrated the branches for "TorBox on the Cloud" and "TorBox mini" into the development branch "torbox_v054." I will work on that branch during the Easter weekend according to the todo list, which I transferred to the discussion section.

from torbox.

gozillah avatar gozillah commented on July 19, 2024

This is very good news, thank you!

So far I used Pi4+, Zero W and Zero 2W, But I now own a Pi5. Would it help if I installed 054 on the Pi5 and did some basic testing? Or do you have test scripts?

from torbox.

radio24 avatar radio24 commented on July 19, 2024

Indeed, testing the "torbox_v054" branch would help me a lot. I am particularly concerned with the following questions:

  • Are there possibilities to make TorBox more user-friendly?
  • I suddenly experienced problems starting up the TorBox with Raspberry Pi 5. Maybe the SD Card in the Raspberry Pi 5 is more prone to fail when pulling out the power before shutting it down properly.
  • I also encountered some disturbing situations after installing the additional network drivers. Once, it seemed that the driver wouldn't work, but after trying it again, it worked fine.
  • I'm also unsure if the additional network drivers should already be installed in the provided image.

I've set up a TorBox chat on my TorBox on a cloud test version: mmx32tjdurtxjrnsh63skku7mg6hdccfzitauppm5y4b2ligqqdqucad.onion.
This is another platform where we can discuss and address any issues you encounter during testing. You (and others) can meet me there.

The same server also runs a test version of the TorBox file server (TFS) with the latest TorBox image: x63xkeiw3cgczc6lcwf62aoe35rp6hfcz3mympmuha7xhj63qdf3ngid.onion
The specific TFS is still based on the older version 1. We have to test the newer version 2, created by Zotil, later.

from torbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.