BitTorrent.bundle icon indicating copy to clipboard operation
BitTorrent.bundle copied to clipboard

Add support for raspberry pi3 (already maded)

Open ignaszewski opened this issue 8 years ago • 13 comments

I like this bundle but I wasnt working on my RPI3. It was missing scrapmagnet binary for ARM processor. It took me a while but I was able to compile scrapmagnetjs into ARM executable file. I forced to use 32bit and replaced binary file from linux_386 to ARM one and it started to work.

It would be nice to have native support for that. Compiled file (by npm nexe): https://www.dropbox.com/s/eyyo7jjwhi4cu0s/scrapmagnet?dl=0

I think that a lot of RPI ussers would be happy of that.

ignaszewski avatar Feb 11 '17 08:02 ignaszewski

Looking at the releases this channel used to support ARM, but was removed in v1.0.0. I'm not sure why. I don't have a RPI to test this on.

JeffreyBytes avatar Feb 12 '17 00:02 JeffreyBytes

See if this works. https://github.com/spaz926/BitTorrent.bundle/tree/arm-support

And if you could tell me what platform.architecture()[0] returns for you with python? I am using os.uname()[4][:3] because I know it returns arm, but if platform.architecture()[0] returns arm then I will use that.

JeffreyBytes avatar Feb 12 '17 07:02 JeffreyBytes

That one doesn't work on my RPI2. Can't play the videos.

sietze535 avatar Feb 12 '17 10:02 sietze535

Sorry. Without an RPI I really can't add support for it. I'm not sure how to auto find that the Plex Server is on ARM other than with what I added in my fork. If the current workaround is working with @ignaszewski's shared binary then keep using it that way until somebody can figure out how to add automatic support.

JeffreyBytes avatar Feb 12 '17 23:02 JeffreyBytes

By the way this is a Duplicate of #63

JeffreyBytes avatar Feb 13 '17 08:02 JeffreyBytes

RPI2 (all versions A/B) use ARM Cortex-A7 CPU - that is 32bit processor. RPI3B (mine, where I compilled executable file) use ARMv8 CPU - 64-bit processor. Thats why binary cant work.

I dont have acces to any RPI 32bit ATM :/

ignaszewski avatar Feb 13 '17 09:02 ignaszewski

The binary in the fork I shared earlier in this thread is your binary. Even though the CPU is a 64-bit processor doesn't mean the operating system is using 64-bit. Rasbian is only using 32-bit still with some optimization for RPI3 last I checked.

Like I said earlier in the thread this is something I'm not going to be able to test without having a RPI on hand which I currently do not.

sharkone/scrapmagnet makefile is set up to build for android-arm and linux-arm, but have no clue if it is compatible with RPI2 and RPI3.

JeffreyBytes avatar Feb 13 '17 09:02 JeffreyBytes

I have used https://github.com/sharkone/scrapmagnet.js (node version of scrapmagnet, it require to manually add some outdated dependecies) and I compiled it to executable using https://github.com/nexe/nexe.

I will try to compile it using Scrapmagnet go version.

ignaszewski avatar Feb 13 '17 11:02 ignaszewski

@spaz926 On my RPI3:

  • platform.architecture(): ('32bit', 'ELF')
  • os.uname(): ('Linux', 'pi', '4.4.38-v7+', '#938 SMP Thu Dec 15 15:22:21 GMT 2016', 'armv7l')

I'm still compiling dependencies to go compiller :P, it will take some time before I will be able to use go compiller.

ignaszewski avatar Feb 13 '17 14:02 ignaszewski

Ok I edited the code using os.uname()[4].startswith('arm')

This should allow the plugin to see any arm processor (be it RPI3's or RPI2's) and assign the correct binary.

https://github.com/spaz926/BitTorrent.bundle/tree/arm-support

JeffreyBytes avatar Feb 13 '17 14:02 JeffreyBytes

I have checked your branch and if I set on 'auto' then video is working (RPI3) but on list I don't have 'arm', just auto, 32 and 64 bit.

Maybe add 'arm' to BitTorrent.bundle/Contents/Services/URL/BitTorrent/ServicePrefs.json ? (but trim that array on windows platform)

ignaszewski avatar Feb 13 '17 15:02 ignaszewski

I will add that as an option, but the way I wrote the if statement it should check if it is arm before looking at the preferences. I'll look at it.

Sent from my iPhone

On Feb 13, 2017, at 09:21, ignaszewski [email protected] wrote:

I have checked your branch and if I set on 'auto' then video is working (RPI3) but on list I don't have 'arm', just auto, 32 and 64 bit.

Maybe add 'arm' to BitTorrent.bundle/Contents/Services/URL/BitTorrent/ServicePrefs.json ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

JeffreyBytes avatar Feb 13 '17 15:02 JeffreyBytes

Ok. I made a few changes. I added the preference for ARM. I also moved architecture to use Plex's built-in Platform API. Hopefully I didn't break anything in the process because I am going off the only API documentation I could find on the Plex forums.

The reason it worked for you on 'auto' is because I edited the code to add support for the auto check for ARM.

For the record, the plugin only looks at the preferences you set if the OS is Linux. For Mac and Windows this preference doesn't matter since there is only one binary for each.

Tell me if it works. If it doesn't please provide me with com.plexapp.plugins.bittorrent.log

Same link as above. https://github.com/spaz926/BitTorrent.bundle/tree/arm-support

JeffreyBytes avatar Feb 14 '17 03:02 JeffreyBytes