-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not resolve dependencies - adafruit-oled-bonnet-toolkit #1
Comments
Oh, sorry, you need to download this dependency, and https://github.com/lukehutch/Adafruit-OLED-Bonnet-Toolkit |
Thank you for that, I really appreciate it, I installed the dependency which allowed NetBeans to make the jar file. 👍 Steps I've taken:
Not quite sure what to do next? Thanks 😄 |
Oh, sorry! I never expected anyone else to actually try to run this code, and you're the first person who has tried :-) (Is this Declan? GitHub doesn't show me your real name.) I ran into the same issue, and reported it months ago, but didn't get a response: Pi4J/pi4j-v2#39 So instead I resorted to just manually copying out the native library that I needed from that jar. I forgot that I made some notes on getting this all working... these may not be 100% correct, but please work through these and let me know if you run into any problems. Then I'll put the instructions on the
|
Thanks again Luke, with all the information you provided I've got this to work. 😄 No I'm not Declan, my names Shaun, I don't know you personally, I was just looking for a USB duplicator as I'm an arcade technician and I'm constantly needing recovery USBs for games and operating systems etc, having a dedicated USB duplicator is a very helpful tool to have and I won't need to tie a computer up using Clonezilla. Searching around the internet I found your GitHub page. I already had the Raspberry Pi Zero but ordered the USB Hub and OLED bonnet as that's what your code was based on. Only issue is I have zero Java experience. 😮 These are the steps I took: Build Machine (MacOS):
Raspberry Pi Zero:
In your TODO file, what did you mean by "Need to unmount after copying has finished, not just sync (otherwise drive dirty bit is set)"? Is there an option to unmount the disks in the UI? I'm currently testing it to see what it can copy. It copied a normal USB with some random files quickly which is nice. I'm currently attempting to clone a Windows recovery USB to see if it will still be bootable, it's been running for some time now with no progress on the bar, but the USB LED is flashing so something is happening. I really need to learn Java because I'd love to implement a shutdown option in the menu and a couple of other ideas. This software you've written is awesome, I have no idea how I'm the first person to attempt to try this code! |
Wow, I'm impressed you got all that working (hardware + software) from the very scant information I provided! This was only really a prototype, and you may run into some bugs and limitations. In particular it doesn't copy the entire drive, only the largest partition (mostly because drives can be different sizes, so copying the partition table over could easily result in a drive that is not readable, since the partition table may indicate the drive is a different size than it is). Therefore a recovery disk probably won't copy well. If you are always copying between drives that are identical in geometry and size, then you could change the copy command in the code to just I didn't realize there was a TODO file in the repo -- everything to do with udisks2 is obsolete. I had too many problems with it, so I switched to udevil instead. I'll have to fix that TODO file (or just remove it). I'm glad you still got it working though. I know Java is not a language that most Raspberry Pi hackers use... One thing you should be aware of is that if you use a USB hub shield on the Raspberry Pi Zero, the screen may freeze and the device may reboot when you plug a drive in. This is known as the "inrush problem". Raspberry Pi Zero skimps on power management components, so can't handle the initial power draw of many USB thumb drives when they are plugged in, without the core voltage rails dropping so low that a reboot is triggered. I actually had to switch to a Raspberry Pi 4B for the latest prototype. Also the pi4j dependency may have some glitches on Raspberry Pi Zero, with GPIO pins being reordered or something, e.g. the dpad or buttons may not operate as expected. Do all those buttons work for you? One more tip, you can add the java launch command to |
Firstly, thanks so much for replying to me so quickly and guiding me 😄 , it was all your help! I'll be honest, I was pretty damn excited when your menu finally loaded up on the OLED display! 😛 I believe you're currently using I know with Clonezilla, you can make a 1:1 copy of a USB drive as long as the destination drive is equal to or greater in size. Is this something I can implement into your 'usb-copier' program? I understand that this is just a prototype program to demonstrate your Adafruit OLED Bonnet Java Toolkit but I really do believe this has real-world uses (especially in my field). I'd seriously pay for this software. I haven't had any issues with the USB hub yet (touch wood), but I will keep an eye on it. I had it running all last night trying to copy a restore USB that is basically a Windows embedded install, It didn't restart but in saying that the progress bar didn't move at all (8 hours or so), as you said it's only copying the largest partition so it probably wouldn't have worked regardless if it finished or not. Regarding the pi4j dependency, I haven't encountered an issue with the d-pad and a/b buttons, everything seems to work as expected which is nice. I did add the java launch command to I'm not sure if you can or have time to help me but here are some things I'm looking for:
Some nice to haves:
Lastly, I just wanted to thank you again for sharing this code free of charge and helping me along the way. Do you have a donation option, would happily send you something. P.S. I saw your profile on Linkedin and I do feel very underqualified to talk to you regarding computers so thank you for your time and help haha. 👍 Cheers! |
Correct.
Here's the current rsync command: https://github.com/lukehutch/usb-copier/blob/master/src/main/java/screen/DoCopyScreen.java#L132 Just replace the varargs parameter at the end (which is turned into an array of Strings by Java) into the command that you want. For example
into the following to use
See this for https://github.com/lukehutch/usb-copier/blob/master/src/main/java/util/DriveInfo.java#L53 Also if you want the progress bar to update during the https://github.com/lukehutch/usb-copier/blob/master/src/main/java/screen/DoWipeScreen.java#L76 Unfortunately this is where it gets a bit more tricky, because this USB copier code uses totally custom process management code so that the whole UI is asynchronous and non-blocking, while being able to launch any number of processes in parallel, with readers consuming input from the output of commandline processes, and allowing for tasks to be canceled, etc. In the most recent link above you can see that https://github.com/lukehutch/usb-copier/blob/master/src/main/java/screen/DoCopyScreen.java#L106 but you'll need to insert a I hope that makes sense... it's not a lot of work in all, but it's a bit complicated to understand what's going on, thanks to the (overengineered) async process architecture! Sorry about that...
Great, glad to hear it.
Switching to However, I have used
Also solved by
This is not explained anywhere, but already drives can be unplugged whenever there is no ongoing disk operation. I was careful to call
Honestly you can just pull the power whenever you're done copying drives! It shouldn't hurt the OS. In the worst case, you might have a missing or corrupted system log entry. But this USB copier doesn't even write to the OS SD card.
I agree, this would be useful. It would require adding a text label UI element with the predicted time in it, and modifying the code that updates the progress line to also produce a time estimate, maybe only after the first 10 seconds have elapsed.
This should be available in the You can see some layout code here (for the wipe operation): https://github.com/lukehutch/usb-copier/blob/master/src/main/java/screen/DoWipeScreen.java#L104 Just add a new Unfortunately I don't have a lot of bandwidth to work on these changes right now! But I hope this gives you some pointers to tinker with it.
Thanks, that's very generous! But you don't need to. I don't feel like I have done much to help at this point. I see being responsive and communicative about code I publish as just the responsibility I assume for putting my code out there. If you want to, you could find some aspiring kid programmer doing some great work, and send them a few bucks -- pass it on :-) The kids need encouragement more than "old" guys like me (44) :-)
Oh, hah, you're too generous, but you're not underqualified, you are figuring this all out. Everybody with earnest questions or asking for help is worth an investment of time. |
Hey @2wenty2wo -- somebody told me about this device. I think this is ideal for your particular usecase. You will save yourself a lot of time and effort by using something off-the-shelf like this! https://www.amazon.com/StarTech-com-Standalone-Duplicator-Eraser-USBDUP12/dp/B00BOK3NQI |
Hi @lukehutch, sorry for not replying to your previous comment, I was trying to see what I could do with your code/advice before saying anything haha. 😄 I had a go at adding the dd command into your code, it worked, I was able to get it to dd clone a USB stick but couldn't wrap my head around implementing the progress bar, so I had no idea if it was working or not. I waited until the morning and it did clone the stick. 👍 I thought I might as well try and make something myself but using something simpler like Python, currently, it doesn't work yet, I've been spending time trying to make a menu system that works with the OLED bonnet. I'm very much a novice so this will take me some time but it's been fun trying to learn this as I go. I made my first repository Rpi-USB-Cloner which has also been fun. I just want to make something basic for myself and if someone that is more skilled than me wants to make it better, I won't complain! 😆 I also linked to your repository as your project was what inspired me to do this. Thank you for sending that link, that device looks very interesting and the price is reasonable for what it does. If my project falls apart, I'll definitely grab a turn-key USB duplicator from Amazon! Thanks again Luke, you're a champion. |
@2wenty2wo they say that necessity is the mother of all invention -- but it is also the origin of all growth! Actually this was my very first RPi project ever, and I learned a ton through building this. So if you value learning new stuff (rather than just wanting a turnkey solution), it's actually a great thing that you're diving into building your own equivalent with Python. It sounds like you found the Adafruit OLED Bonnet Python library, so that you're not starting at zero like I did in Java? There's no menu system in that library, but it will at least render text on the screen for you, so you should be able to hack some basic textual interaction code together from that starting point. Anyway, wishing you best of luck for your project! |
Sorry to bring back up an old issue, but I ended up seeing the project and really liked the features described in this chain, so I implemented most of them as a fork (a new DD copy menu with progress menu described above and wipe of entire disk). However, I noticed there was not built in functionality to read the raw disk (ex. /dev/sda) size due to the use of df. I tried to implement similar code from other code I see from DriveInfo.java and having it reference in DiskMonitor.java and the DoCopy clone Java code for DD, but it did not end up working. Can I get a pointer on how you might do this? Added in code to DriveInfo.java to run lsblk to get selected device's raw disk size:
|
@alvin-000 very cool that you worked on this! What do you mean by "it did not end up working"? I'm not sure where to start advising you :-) |
My bad on that. When I got the progress bar working, I found out diskSize is actually partition size of volume, which is a bit problematic for my progress bar when you have a multi partition volume (like a cloning a Raspian SD card). Review of the original code shows you used df to get the info, which does not include full/raw disk size. So I aimed to just add in a function to DiskInfo.java to get that info. Initialize public variable:
Function to get full/raw disk size via lsblk. I am kind of assuming I can just take the sdrout and make it into a global variable.
I then added references to the new function above wherever I saw driveInfo.updateDriveSizeAsync() as that looked like another update disk size function (so like DiskMonitor.java and later in the DD copy Java script.
Lastly, I modified the dd execution code to use the new variable for the progress bar and the former MSG for files:
Everything compiles fine and when I check the nohup.out file I can see my lsblk command is run. However, I do not see the print out for success or the error message built into the function. Review of the selectedDrive.realDiskSize is MSG on the device, shows my value is -5 (the initialize variable). Any ideas what I might be doing wrong? |
OK, so I'm assuming you mean that the callback code that reads from Try extracting just the It has been so long since I have looked at this that that's the best suggestion I have right now! |
Thanks for the suggestion, I think I might have actually figured out the issue from debugging with just |
I'm not sure how to fix but it failed to compile with the following error:
The text was updated successfully, but these errors were encountered: