davidferguson / pibakery

The blocks based, easy to use setup tool for Raspberry Pi
http://www.PiBakery.org
GNU General Public License v3.0
1.48k stars 146 forks source link

Cannot locate "the blocks" #81

Open RichardBronosky opened 7 years ago

RichardBronosky commented 7 years ago

I feel like a complete idiot, but I cannot find the blocks in the pi-bakery app. I wanted to try https://github.com/davidferguson/pibakery-blocks/tree/master/retropiesetup so I cloned that repo and dragged the retropiesetup folder to the pibakery window and it says I'm about to overwrite an existing block. What? I can't find the block. I can find any of the block from the pibakery-blocks repo or https://github.com/davidferguson/pibakery/tree/master/pibakery-blocks

What am I missing?

2014-03-19 16 22 38

screenshot 2016-11-23 23 35 46

tenten8401 commented 7 years ago

PiBakery-blocks are all installed by default, he just made a separate repo for them. I'm unsure why something like RetroPie is disabled but I'm willing to bet it's still a work-in-progress

RichardBronosky commented 7 years ago

If we compare category:software in these 3 locations, you'd expect it to show up in the app. https://github.com/davidferguson/pibakery-blocks/blob/master/retropiesetup/retropiesetup.json https://github.com/davidferguson/pibakery/blob/cb9b3e5f9b2999177c212fa34adfc7e82a6d55e5/pibakery-blocks/categories.json https://github.com/davidferguson/pibakery/blob/cb9b3e5f9b2999177c212fa34adfc7e82a6d55e5/app/index.html

davidferguson commented 7 years ago

I'm unsure why something like RetroPie is disabled but I'm willing to bet it's still a work-in-progress

Yes, if a block hasn't been enabled yet, it's probably because I found an issue with it. From memory, I think Retropie is a interactive install, which obviously doesn't work with PiBakery.

RichardBronosky commented 7 years ago

How do scripts get enabled and disabled?

Also, how do you do first run scripts on Raspbian via Mac? I tried to make sense of your code but kept getting lost. I really don't know what you could do to an SD card to cause Linux to run a script at boot.

tenten8401 commented 7 years ago

@RichardBronosky image Not sure if that's what you were asking or not, but that's what I thought you meant.

If you want a way to do it without PiBakery, put your "sh ./bla_bla.sh" in /etc/rc.local or make it a service in /etc/init.d/service_name

RichardBronosky commented 7 years ago

That is what I meant, but you can't mount that partition on a Mac. Only the /boot partition can be mounted.

tenten8401 commented 7 years ago

@RichardBronosky http://osxdaily.com/2014/03/20/mount-ext-linux-file-system-mac/

RichardBronosky commented 7 years ago

I've been down the FUSE rabbit hole. It was disaster. Is that how pibakery is doing it?

JasperAlgra commented 7 years ago

I'm running into the same issue as @RichardBronosky . I tried to add a custom block, but it won't show up in the GUI.

Block:

{
    "name": "narrowcasting",
    "text": "Narrowcasting \\nWebsite: %1",
    "script": "narrowcasting.sh",
    "args": [
        {
            "type": "text",
            "default": "http://theslideshow.net/#simple/raspberry%2Bpi",
            "maxLength": 0
        }
    ],
    "network": false,
    "continue": true,
    "type": "setting",
    "category":"setting",
    "supportedOperatingSystems": [
        "raspbian-pibakery.img",
        "raspbian-lite-pibakery.img"
    ],
    "shortDescription":"Run website for narrowcasting",
    "longDescription":"Run website in Chromium Browser Kiosk mode"
}

I've based this json on the authorizekey block from your repo.

Also, in windows dragging and dropping blocks doesn't work, probably due to the elevation of the bakery executable, so I'm adding the block by 'ctrl shift plus'. After adding it states imported block. 'narrowcasting' will be available to use until you next restart PiBakery. but after a restart it doesn't show in any of the categories.

Is there any was I can debug this or help?

JasperAlgra commented 7 years ago

At the moment I see some pretty random behaviour. Almost immediately after posting my last message the narrowcasting plugin/block I've made was indeed available in the setting list. I even succeeded to make a working image out of it. Export/import of the xml of buildingblocks also worked. but.. after re-importing the custom block import of XML silently fails + the block is not available anymore.

Some more verbose messaging would be great. Can I enable that somehow? Or can I run the program via npm on windows to debug?

Cheers,

Jasper

JasperAlgra commented 7 years ago

I've installed electron-debug (https://www.npmjs.com/package/electron-debug) and I'm trying to debuggin the app now via Jetbrains IntelliJ, wich is quite a pain in the ass due to the elevation and killing of the main process.

Directly after import (crtl shift plus), select dir in explorer, press ok: pibakery.js:2453 Error: ENOENT: no such file or directory, stat 'C:\repos\pibakery\pibakery\pibakery-blocks\narrowcasting' at Error (native)

The problem seem to lie in the importBlock() function.

To recreate the problem, just add (ctrl shift plus, or drag, I can because I've disable the elevation) the block from any dir into the app. This gives either a "Imported Block...restart PiBakery" or "The block you are trying to import conflicts with a block already imported into PiBakery. Do you want to overwrite the existing block?" depending on the availability of the block dir in "pibakery-blocks" dir. I can "get it right" now by copying the block dir into the "pibakery-blocks" dir, adding it in the GUI, accepting the warning of ovveride. Then I see my block directory being deleted, add it back manually (copy paste), and THEN it pops up in the console.

Also another issue related to this. When you export an 'cookbook' XML file (with the puzzle tiles) and import it, it silently fails when on the block is unavailable.

For now I've got to get back to my main job so I'm not planning on debugging this furter, but if I can be of any assistance in testing this on windows please let me know soon. :)

Also if I may suggest a small change to make debugging a lot easier; wouldn't it be possible to only use elevation for the actualy sd-card writer process instead of the complete app?

Cheers,

Jasper

javi9231 commented 7 years ago

I have managed to show the modules.

The problem is that they are not written in info.json from the directory pibakery-blocks pibakery_info You have to write the modules you need, When restarting pibakery you can see them pibakery_modules

Regards