TL-866 EPROM programmer OSX software

Discussion in 'Mac Programming' started by macstatic, Feb 12, 2017.

  1. macstatic macrumors 6502a

    Joined:
    Oct 21, 2005
    #1
  2. Toutou macrumors 6502a

    Toutou

    Joined:
    Jan 6, 2015
    Location:
    Prague, Czech Republic
    #2
    I tried this for you and it seems to do something. (it's a a command line app)

    The process is pretty straightforward, just get the app from Github (download directly or via git if you're familiar), then enter the directory in terminal and run
    Code:
    make
    , then
    Code:
    sudo make install
    .

    You'll need the libusb library (available from Homebrew) and the xcode command line tools (a prompt will come up automatically if you don't have them)

    Just ask if you have any questions.
     

    Attached Files:

  3. macstatic thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #3
    Thanks for looking into it.
    Command line app! Ouch :(
    Oh well, as long as I won't be burning EPROMs daily and know exactly what to type beforehand I guess it should do the job.

    1) which files exactly do I need to get from the Minipro GitHub page? There's a long listing of files and folders to choose from.

    2) I believe I found the Homebrew site -that's the correct one, right?
    So I copied the command line as in structed on the top of that page, as follows:
    Code:
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    ... and pasted it into my terminal window which proceeded by installing a bunch of stuff.
    Correct so far?

    3) I didn't quite understand the part about libusb, but (after a quick read through the Homebrew site) I made a guess and entered the following in the Terminal:
    Code:
    brew install libusb
    ... which resulted in the following:
    Looking good so far?

    4) How do I install Xcode? I'm not sure if I missed a prompt or not when installing Homebrew or libusb.

    5) So once I get Xcode installed I assume I've prepared my Mac for allowing the MiniPro software to be compiled to I can actually run it, right?
     
  4. Toutou macrumors 6502a

    Toutou

    Joined:
    Jan 6, 2015
    Location:
    Prague, Czech Republic
    #4
    You did everything right, the first command installed Homebrew onto your computer and the second one told Homebrew to get you the libusb library.
    And guess what? Homebrew got the libusb from github and, right here:
    Code:
    ==> ./configure --prefix=/usr/local/Cellar/libusb/1.0.21
    ==> make install
    COMPILED it.


    Soo, now you will need your app. Above the long list of files, on the left side, there is a green button that says Clone or download. Click it, then Download ZIP.
    Unpack the archive, a new folder "minipro-master" will appear.

    Now the fun part - launch the terminal and enter the "minipro-master" folder, like this:
    Code:
    cd path/to/the/minipro-master
    If you're not sure about the exact path, just type "cd " (with the space!) and drag the folder from Finder to the Terminal window. On my machine that would be
    Code:
    cd /Users/toutou/Downloads/minipro-master
    Now you're in the correct folder to begin the horrible and mystical ritual of — [violent thunder, a lightning strikes] — COMPILING!!!!
    Code:
    make
    And that's it. That's how you compile 98% of things. (There's usually a file called "Makefile" that contains all the commands necessary, and the "make" command interacts with this file).

    The app is now a binary ready to be launched, but it still needs a couple of its files and directories prepared here and there, a process best known as "installation":
    Code:
    sudo make install
    essentially you're telling the "make" utility to run the "install" sequence from the Makefile. And with "sudo" you're running this as a root user (the god almighty). You'll be prompted for your password. Enter it (nothing will appear, no asterisks or anything).

    Boom. Your app is ready to be launched as "minipro".
     
  5. macstatic, Feb 16, 2017
    Last edited: Feb 16, 2017

    macstatic thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #5
    Cool! Your explanation is very clear, but I must have done something wrong with the libusb installation as the following error message comes up when trying to "make" (after having unzipped the downloaded file from Github):

    Code:
    $ make
    cc -g -O0 `pkg-config --cflags libusb-1.0`   -c -o byte_utils.o byte_utils.c
    /bin/sh: pkg-config: command not found
    cc -g -O0 `pkg-config --cflags libusb-1.0`   -c -o database.o database.c
    /bin/sh: pkg-config: command not found
    cc -g -O0 `pkg-config --cflags libusb-1.0`   -c -o minipro.o minipro.c
    /bin/sh: pkg-config: command not found
    minipro.c:1:10: fatal error: 'libusb.h' file not found
    #include <libusb.h>
             ^
    1 error generated.
    make: *** [minipro.o] Error 1
    $ 
    What do I need to do now?
    I might add that my Mac is set up for multiple users. I always log in as a "standard" user, but if I install something I have to enter the "admin" username and password. And this is where things get confusing, because when I'm asked to "sudo" I never get it to work unless I first do a "login admin_username" (where "admin_username" of course is the admin's username, followed by its password), but then again I don't get access to the files/folders that belongs to my standard user... Maybe that's partly where the above problems lie.

    Also, will this app end up in the usual /Applications/ folder, another "common access" folder (such as /System/ or /Library/) or somewhere within my own user folder so I have to use the "sudo" command every time I need to use this particular command line app?
     
  6. Toutou macrumors 6502a

    Toutou

    Joined:
    Jan 6, 2015
    Location:
    Prague, Czech Republic
    #6
    The multiuser setup shouldn't be a problem. Your homebrew installation looks fine.
    The first error in the output is at
    Code:
    /bin/sh: pkg-config: command not found
    So let's make sure you have that tool:
    Code:
    brew install pkg-config
    (I didn't get this error because I have it.)

    After this both the pkg-config tool and the libusb library should be ready and
    Code:
    brew list
    should list both.

    If everything looks good, try again.
     
  7. macstatic thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #7
    One step further....
    Your suggestion worked, so now I have "pkg-config" installed.
    "Brew list" shows two items: libusb and pkg-config

    but..... this multi-user/sudo thing is confusing me.
    For instance, this is what happened when I tried to do the above (logged in on my Mac as my normal user):

    In the above example I enter my normal user's password, which obviously doesn't work.
    so next I try to use my admin username instead (still logged in on my Mac as a normal user):

    So since none of that worked I logged in as the admin within the Terminal (still logged into the Mac as a normal user though):

    This time it worked!
    Now it's time to install the MiniPro software.
    I don't quite understand how I got "make" to work earlier, but perhaps I could do that even without being an admin. However, doing a sudo make install appears to ask for the admin username which (as shown earlier) never works regardless which password I give it.
    The whole thing appears to be a chicken & egg situation.
    If login as the admin, then try to cd to the "minipro-master" directory I'm denied that:

    So next I go to the Terminal, logout (so I'm back to the regular user), cd to the above directory and try to install, which also doesn't work (probably because I'm not an admin):


    So is the solution to put the installation files on a USB memory stick, logout as my normal user on the Mac, log into the admin user area, then install everything from there? Cumbersome, so I hope there's some easier way.
     
  8. Toutou macrumors 6502a

    Toutou

    Joined:
    Jan 6, 2015
    Location:
    Prague, Czech Republic
    #8
    $ whoami
    MY_USERNAME
    $ sudo chown -R $MY_USERNAME /usr/local/Cellar

    Correct idea, incorrect usage. (But that's okay, this can be a little confusing)
    Look at this example: (the echo command just prints output)
    Snímek obrazovky 2017-02-18 v 16.18.46.png

    "whoami" is a command that prints (returns as an output) your current username, as in "who am I?"

    "echo $whoami" literally means "print the value of a variable called whoami" — nothing happens, I didn't create the variable.

    "echo $toutou", again, just prints the empty variable toutou

    "$(command)" means "run this command and just put the output here", so "echo $(whoami)" means literally "print whatever output the "whoami" command will produce".

    The last one is an example of how variables work. First I'm telling it to, literally, "take whatever output the "whoami" command will produce and store that as variable called X", and then the second command is "print the value of a variable X".

    Your command "sudo chown -R $MY_USERNAME /usr/local/Cellar" would, as you now know, change ownership of the directory (+ everything inside) /usr/local/Cellar to a user whose name is stored in a variable called MY_USERNAME.

    The correct form:
    Code:
    sudo chown -R $(whoami) /usr/local/Cellar
    will literally tell it to "change ownership of the directory (+ everything inside) /usr/local/Cellar to a user whose name gets printed by running the "whoami" command.
    Which is exactly what you wanted to do.

    But I believe this isn't necessary, the directory should already be owned by your admin user.

    Now, this:
    Code:
    -bash: cd: /FILEPATH/minipro-master: Permission denied
    does make sense. The minipro-master folder belongs to your normal user, right? Not to your admin user. The admin in OSX is not an actual root account ("root" in the Unix lingo), it's just a user that is able to request root privileges via "sudo".

    Login into your admin account. Try to cd into the folder, it won't let you. But we won't be needing the folder anymore, so let's just ruin it.
    Code:
    sudo chmod a+rwx /path/to/minipro-master
    literally "give (+) everyone (a) permission to read/write/execute (rwx) in the folder.

    This will prompt you for a password, and because you're logged in as your admin, enter your admin user password. This should work 100% if you can log in with the same password.

    And then give the "sudo make install" a go. That one won't work without "sudo" at all.
     
  9. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #9
    You can't use 'sudo' from your normal user account. You must be an admin user to use 'sudo'.

    When you're logged in as your admin user, you can add your normal user account name to the file /etc/sudoers. You should read about how to do this correctly, lest you bork the sudoers file. Google: add user to sudoers.


    A completely different approach would be to change the permissions of /usr/local/Cellar so your normal user account has write permission. Post the complete output of the following command line:
    Code:
    ls -ld /usr/local/Cellar ; id
    In general, the approach would be to give /usr/local/Cellar a group that your user is a member of, or to add your user to the group already assigned to /usr/local/Cellar. A suitable choice will be apparant after seeing the output from the given command line.

    Also, changing the group of /usr/local/Cellar requires ownership or being root, and joining a group requires being root. This means you'll be using your admin account to make the changes, not your normal account.
     
  10. macstatic thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #10
    Yes, your explanation makes sense, but it's often difficult to understand the different syntaxes in command line examples, like here where I should use the brackets literally.



    Yes, I took a look and you're right.


    I guess this makes sense when I take a look at the "Users & groups" system preference where I can tell if a certain user should be an admin or standard user. I just never looked at it that way.
    So "root" on the other hand is an actual user account, which by default has those same priveleges as any user who has been defined as an "admin"?


    (after spending lots of time trying all this and more without it working...) I decided to give the "make" command a go (even though I had done that before), so I did, then continued with "sudo make install" (still logged in as the admin user via the Terminal) and presto! it works :)
    I'm not sure what went wrong where, but at least I got it installed (I entered "minipro" in the Terminal and it responded with a list of options.

    So, do I still need to have Homebrew installed in order to have it working, or was that just for compiling it? If it takes up a lot of room and I don't need it I might just as well uninstall it (I noticed there were instructions for that on the Homebrew website).
     
  11. repetto74 macrumors newbie

    Joined:
    Oct 22, 2017
    #11
    Hi,

    I am trying to install this open source program to control the TL866 programmer under Mac OSX. I have successfully given the Sudo Make Install command but then I do not know what I am supposed to get back?
    Where is the compiled program? In the Minipro-master folder I do have a couple of Unix exec being created but they just give a list of commands when double-clicking on them.
    I am supposed to have a DMG package to install or what? Sorry I am not an expert of Unix command Line installations :(




     
  12. macstatic thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #12
    It's been a while since I did the above and don't remember the details, but I concluded that having a command-line based EPROM programmer wasn't my thing as there are too many details to keep track of, so I ended up creating a Bootcamp partition with Windows on it, then installing the actual software that came with it. For me, this works a whole lot better even though I wish there was a Mac version of the software.
     
  13. Toutou macrumors 6502a

    Toutou

    Joined:
    Jan 6, 2015
    Location:
    Prague, Czech Republic
    #13

    After the make install command the utility should be already installed on your system and should be available as "minipro" in the terminal. Again, this is a command line app, you're not supposed to see any user interface.
     
  14. repetto74 macrumors newbie

    Joined:
    Oct 22, 2017
    #14
    Hi Toutou,

    OK thanks for the clarification. Well this is looking a little bit too complicated then to run for me. Better to switch on Windows when IC programming is required then :).

    Thanks
    Rick
     
  15. macstatic thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #15
    I think that might be the simpler solution. So far I haven't run into any problems using the Windows software along with the said EPROM programmer on my Mac with Bootcamp.
     

Share This Page