08-28-13 02:13 AM
30 12
tools
  1. Omnitech's Avatar
    I've been wanting to do some poking around and troubleshooting on my Z10 beyond what I can do via the UI tools or commonly available apps, and now see there is a native tool (originally written for the Playbook) that provides access to the BB10 QNX console or command-line called "BGShellPlus", written by Evgeny Yurchenko.

    Actually it comes in 2 variations, one is listed in Blackberry World as BGShell, the other one is listed as BG SSH-SCP-SFTP free, though it's colloquially referred-to as "BGShellPlus" and includes some network utilities as well.

    Problem is, they are both free apps with virtually no documentation, described by the author as "alpha" and "as-is", and while he says comments are welcome (indeed, posts 2 email addresses right in his app descriptions: support@tm-k.com and bgmot@tm-k.com), rather than spam him with a bunch of inane questions, I thought I'd create a thread here where some of us can discuss our tips/tricks.

    The first problem I'm having is I can't seem to get the "break" or "CTRL-C" command to work. There are some buttons that appear above the console including one labeled "Ctrl+" which I assume allows entry of control-characters, but I've repeatedly tried either simultaneously or sequentially pressing this in combination with "C" and it doesn't do anything.

    Second issue I'm having is despite the fact that QNX includes many common POSIX/Unix/Linux tools/commands, I can't get basic things to work like piping output, for example through a pager utility. (ie "cat filename |less")

    QNX appears to have a "quirky" implementation of many common tools, and unsurprisingly since BB10 isn't designed for users to play around with at a command-prompt, it doesn't seem to have any manpages or even rudimentary command syntax help. Luckily I found a good publicly-available command reference from QNX here:

    Help - Eclipse SDK

    I also found some forums pertaining to QNX, I'm not yet sure what OpenQNX is or whether it is officially sanctioned by QNX or not (the "official" QNX support forums seem to be locked-down to QNX customers):

    Index page | www.openqnx.com

    Lastly, for the sake of expediency, some common filesystem shortcuts:

    /sdcard2 The external/removable user-accessible memory card filesystem
    /sdcard The internal user-accessible memory card filesystem
    05-19-13 05:21 PM
  2. zocster's Avatar
    Watching this also...

    Sent from my Z10 using Tapatalk 2
    05-19-13 05:53 PM
  3. xsacha's Avatar
    vi: elvis
    ps: pidin
    top: hogs

    When you want to know how an app works:
    use appname
    05-19-13 07:24 PM
  4. Omnitech's Avatar
    vi: elvis
    ps: pidin
    top: hogs

    When you want to know how an app works:
    use appname

    Ah, the "use" command is very helpful in addition to those things you told me earlier. Like a simple 'man' command. Thanks. (Strange thing is pidin supports the "-h" argument, which acts the same as the "use pidin" mechanism. None of the other tools I've tried do.)

    Right now trying to figure out how to get limited output out of pidin and hogs. Hogs appears to run continuously with no option for single-screen snapshot. If I redirect it to a file it keeps adding continuously and since CTRL-C doesn't work, I have to kill the console to get out. Same thing with pidin.
    05-19-13 07:47 PM
  5. xsacha's Avatar
    Yes, hogs isn't exactly top.
    You can compile top for QNX though. There was one floating around for Playbook before.
    05-19-13 09:10 PM
  6. Omnitech's Avatar
    Thanks but the bigger problem right now is to get control commands and pipes to work.

    If I can do that, then I can start building a script to log the things I want to log.

    Pity BGShell/Plus doesn't seem to work in landscape mode though. All the output of those commands wraps for days in portrait mode...
    05-19-13 10:48 PM
  7. xsacha's Avatar
    Pipes work fine. If you mean you can't find the key on your keyboard, that's because Sym key doesn't work in BGShellPlus.

    Just ssh in to your device and run the script from there.
    05-20-13 12:14 AM
  8. Omnitech's Avatar
    Pipes work fine. If you mean you can't find the key on your keyboard, that's because Sym key doesn't work in BGShellPlus.

    Just ssh in to your device and run the script from there.

    What do you mean by "doesn't work"? Because the characters I type using the Sym key certainly echo back to me when I type them, and seem to work in other contexts, ie "hogs -% 2" definitely trims the list of processes to ones with only 2% or higher CPU utilization.
    05-20-13 01:23 AM
  9. Omnitech's Avatar
    FWIW, I can ping the device but cannot SSH to it. I assume there's something I need to do to enable the daemon or open the firewall or something?

    (Edit: I'm seeing some docs that refer to needing a debug token that needs to be generated by a development tool, then connecting via BB Link and the dev tools etc.. if that's really the case then it sounds like we're back to Shaosoft's suggestion in the other thread about just ssh'ing from the dev environment, which I was hoping to avoid.. )
    Last edited by Omnitech; 05-20-13 at 01:44 AM.
    05-20-13 01:27 AM
  10. xsacha's Avatar
    Oh the Sym key works for you? It's not working on my Q10, in BGShellPlus.

    Yeah you need to run blackberry-connect to enable SSH.
    If you have a Playbook or something, you can SSH to your Z10 from there.
    I have reverse-engineered blackberry-connect so I can make an app that runs it for anything (including Playbook).
    05-20-13 04:36 AM
  11. Omnitech's Avatar
    Oh the Sym key works for you? It's not working on my Q10, in BGShellPlus.

    Yep. And I don't know about BGShellPlus, maybe this thing called "BG SSH-SCP-SFTP free" is not really BGShellPlus, but something else? Because there is no "BGShellPlus" in Blackberry World that I could find.

    Even the developer mentions in the app descriptions on both versions to turn off all the text prediction features because it would cause problems entering commands (sounds reasonable), but actually I find that the dev must have figured out how to programmatically disable those features because when I use "BG SSH-SCP-SFTP free", the keyboard predictions seem to be disabled just for that app. If I go into some other pseudo-shell app like "System Information" by mappau OG, I see that the keyboard predictions are back on again. (Which is great, actually, because it means I don't have to keep globally disabling that just to make the console app usable.) I'm also using a Z10, so maybe that's a factor.


    Yeah you need to run blackberry-connect to enable SSH.
    If you have a Playbook or something, you can SSH to your Z10 from there.
    I have reverse-engineered blackberry-connect so I can make an app that runs it for anything (including Playbook).

    Yes I heard about your projects, hopefully I will have a 'scratch' device someday I don't mind playing with, I'd love to play around with alternative OS's on something I don't have to depend on so much.

    Interesting idea re: the Playbook. Might make it almost worthwhile to get one on craigslist or something just for that. I just don't want to have to install some big development environment on a machine or VM here just to ssh to the Z10.
    05-20-13 05:26 AM
  12. sanaking's Avatar
    Is BGShell the only working Terminal/CLI? It's the only one I could find, at least.
    I'm missing the normal GNU tools, like diff! And actually I don't even seem to have vi nor elvis on my device (10.1, does that matter?)
    Is there a collection of tools already ported over somewhere? If not, that's a repository worth making! The fact that I had trouble finding any information on it of this on the internet (and on here possibly, haven't finished searching), makes me wonder if I've come to a platform devoid of the *nix people always playing around that I'm accustomed to..
    (Having used Palm webOS and Android before this, and Linux on the desktop, I'm pretty much used to having any tools I'm looking for easily available, in Preware or the app catalog resp (for webOS/Android))
    Speaking of preware, an alternate app store, if only for this stuff (and yes even though it couldn't install to root) would be awesome!

    Posted via CB10
    05-25-13 09:54 PM
  13. Omnitech's Avatar
    Is BGShell the only working Terminal/CLI? It's the only one I could find, at least.
    I'm missing the normal GNU tools, like diff! And actually I don't even seem to have vi nor elvis on my device (10.1, does that matter?)
    Is there a collection of tools already ported over somewhere? If not, that's a repository worth making! The fact that I had trouble finding any information on it of this on the internet (and on here possibly, haven't finished searching), makes me wonder if I've come to a platform devoid of the *nix people always playing around that I'm accustomed to..
    (Having used Palm webOS and Android before this, and Linux on the desktop, I'm pretty much used to having any tools I'm looking for easily available, in Preware or the app catalog resp (for webOS/Android))
    Speaking of preware, an alternate app store, if only for this stuff (and yes even though it couldn't install to root) would be awesome!

    Embedded devices rarely have all the tools and functions an end-user OS has because A) they don't need them, B) they take up too much space, and C) it makes it easier for users to shoot themselves in the foot.

    Right now, I'd settle for control-characters and pipes to work through that one on-device console tool.
    05-25-13 10:52 PM
  14. sanaking's Avatar
    Oh and somehow I have both BGShell and plus installed.
    I guess I need to start another thread for my questions/ideas, I mistakenly thought I was following up and as such could extend the discussion.
    05-26-13 12:54 AM
  15. gariac's Avatar
    It looks like this thread died, but having recently discovered BGShellPlus, I have to say the app is cool. No help file since the authors assumes you know QNX. A lot of linux commands work. You can certainly poke around the device file structure.

    The obvious intent was for the user to enter sftp or similar for file transfer. The fact you get a terminal prompt for hacking is just a bonus.
    06-14-13 02:20 AM
  16. offyoutoddle's Avatar
    Has anyone actually got it to work? I can't ping anything - it says command not found, and I can't get ssh to work to any of my networked servers - i get a can't assign requested address message?
    08-23-13 03:05 PM
  17. Omnitech's Avatar
    Has anyone actually got it to work? I can't ping anything - it says command not found, and I can't get ssh to work to any of my networked servers - i get a can't assign requested address message?

    It's not Linux and many utilities you may be used to on a full Linux installation are not there. See the earlier posts in this thread.

    It's a POSIX compliant OS but that doesn't dictate things like whether it has a "ping" or "traceroute" executable included.

    QNX documentation is publicly available on the web, in fact I posted links to some of it in the OP.

    Lastly - user sessions are sandboxed/chrooted/jailed by default for security purposes and you don't have root access, so many commands that might otherwise show systemwide info are not going to work the way you expect.
    08-26-13 09:50 AM
  18. offyoutoddle's Avatar
    It's not Linux and many utilities you may be used to on a full Linux installation are not there. See the earlier posts in this thread.

    It's a POSIX compliant OS but that doesn't dictate things like whether it has a "ping" or "traceroute" executable included.

    QNX documentation is publicly available on the web, in fact I posted links to some of it in the OP.

    Lastly - user sessions are sandboxed/chrooted/jailed by default for security purposes and you don't have root access, so many commands that might otherwise show systemwide info are not going to work the way you expect.
    understood, something I worked out fairly quickly, but ssh is in there for sure - are you saying it is sandboxed such that it cannot make a connection to another host then?
    08-26-13 05:03 PM
  19. Omnitech's Avatar
    understood, something I worked out fairly quickly, but ssh is in there for sure - are you saying it is sandboxed such that it cannot make a connection to another host then?

    No, the SSH function should work.

    Just tested it now - there is a public ssh server at sdf.org that you can use to test, ie "ssh sdf.org". When I tried it just now, it gave the expected unknown RSA key fingerprint warning that you get prior to connecting to a new host.
    08-26-13 06:03 PM
  20. offyoutoddle's Avatar
    that's all I want it for to be honest. Trying to ping something was my first step in diagnosis, as I thought maybe i had a network connectivity issue. Connecting to sdf.org fails, as does conenction to my internal network's servers, although this time it fails with a slightly different error - no address associated with hostname - previously the failure claimed 'can't assign requested address'.

    ssh to his address works fine from any laptop on the same network.
    08-26-13 06:19 PM
  21. Omnitech's Avatar
    that's all I want it for to be honest. Trying to ping something was my first step in diagnosis, as I thought maybe i had a network connectivity issue. Connecting to sdf.org fails, as does conenction to my internal network's servers, although this time it fails with a slightly different error - no address associated with hostname - previously the failure claimed 'can't assign requested address'.

    ssh to his address works fine from any laptop on the same network.

    You've either got some sort of general networking error/incompatibility on your device (VPN? Incompatible proxy?), or perhaps one of the older OS's with a crappy Android runtime or whatever toolset that that app was written in.
    08-27-13 01:22 AM
  22. offyoutoddle's Avatar
    Ok then let's hope 10.2 brings better things. Cheers

    Posted via CB10
    08-27-13 02:51 AM
  23. Omnitech's Avatar
    Ok then let's hope 10.2 brings better things. Cheers

    You don't need 10.2 to make this work. I tested this on 10.1, and I believe it works on earlier ones fine for the most part.
    08-27-13 06:42 AM
  24. offyoutoddle's Avatar
    I have latest 10.1 official release 10.1.0.4181

    Posted via CB10
    08-27-13 07:29 AM
  25. xsacha's Avatar
    that's all I want it for to be honest. Trying to ping something was my first step in diagnosis, as I thought maybe i had a network connectivity issue. Connecting to sdf.org fails, as does conenction to my internal network's servers, although this time it fails with a slightly different error - no address associated with hostname - previously the failure claimed 'can't assign requested address'.
    By the way, ping seems to require root on 10.2.
    You can actually ping though if you use your own app.
    Pretty silly.
    08-27-13 09:42 AM
30 12
LINK TO POST COPIED TO CLIPBOARD