Hantek 6022be on linux can't see device using sigrok firmware and pulseview - Page 1
Forum section: electronics / testgear

author: comicpilsen
author_rank: Contributor
timestamp: November 16, 2017, 02:33:55 am
content: hi all new to forum and new to EE in general.I bought a hantek 6022be for my new hobby but I didn't know the software for it was only for windows. I tried to follow the instructions to download the prebuilt drivers also sigrok and pulseview. Pulseview starts up but no sign of the Scope on the dropdown. A friend tested it on his windows laptop and it works, I calibrated the probes. BUT no luck on my Ubuntu machine. Can someone point me at the correct instructions please. Here is what I tried to get it working:downloaded sigrok firmware for hantek 6022be as per instructions onhttps://sigrok.org/wiki/Hantek_6022BEthis gets me the prebuilt firmwarehttps://sigrok.org/download/binary/sigrok-firmware-fx2lafw/which I put into /usr/local/share/sigrok-firmwareI sudo installed pulseview so I have a frontend which I thought loaded the firmware from /usr/local/share/sigrok-firmware

author: daybyter
author_rank: Frequent Contributor
timestamp: November 16, 2017, 04:33:01 am
content: I use OpenHantek on my Linux box with the 6022be.Or I use the RichardK Software in a VirtualBox.That is 2 additional options for you.When you plug the scope in, do you see a message at the end of the dmesg output? When the firmware is uploaded to the scope the USB ID of the scope should change.

author: comicpilsen
author_rank: Contributor
timestamp: November 16, 2017, 04:41:17 am
content: Hey daybyterthanks for the extra ideas, I didn't know about Openhantek at all. How did you install it properly please? I was going to download the tar from herehttp://openhantek.org/don't want to use virtualbox as I am a smidgen wary of it, I'd like to get this working in pure linux.and HOPE :-) that the instructions were clear as I seem to be messing this all up right now. I didn't think to look at the dmesg output at all so AGAIN thanks for that, I must be getting punchy.thanks again for the reply and GREAT ideas.comicpilsen

author: daybyter
author_rank: Frequent Contributor
timestamp: November 16, 2017, 05:38:00 am
content: I cloned the sources from github and compiled it by myself.https://github.com/OpenHantek/openhantek/blob/master/readme.mdI had some issues with triggers, but I use singleshot most of the time anyway, so it's not really an issue.There is a huge 6022be thread in this forum, where you can find some linux users.

author: comicpilsen
author_rank: Contributor
timestamp: November 16, 2017, 12:42:27 pm
content: thanks again for your help daybyter I still want to get sigrok working and think I must be close. The GREATEST piece of help you gave me was to point out that I had been searching for the WRONG MODEL NUMBER!! seriously thanks again for your help and I will now continue my journey searching for the Hantek 6022be NOT the mythical Hantek 6602be :-)cp

author: hermit
author_rank: Frequent Contributor
timestamp: November 16, 2017, 05:19:49 pm
content: Have you checked your package manager? I use Debian and have this installed.sigrok-firmware-fx2lafwIt installs here:/usr/share/sigrok-firmware/usr/share/sigrok-firmware/fx2lafw-braintechnology-usb-lps.fw/usr/share/sigrok-firmware/fx2lafw-cwav-usbeeax.fw/usr/share/sigrok-firmware/fx2lafw-cwav-usbeedx.fw/usr/share/sigrok-firmware/fx2lafw-cwav-usbeesx.fw/usr/share/sigrok-firmware/fx2lafw-cypress-fx2.fw/usr/share/sigrok-firmware/fx2lafw-saleae-logic.fw/usr/share/sigrok-firmware/fx2lafw-sigrok-fx2-16ch.fw/usr/share/sigrok-firmware/fx2lafw-sigrok-fx2-8ch.fw

author: comicpilsen
author_rank: Contributor
timestamp: November 16, 2017, 05:39:17 pm
content: Hey Hermitthanks for the replyawesome username by the way. When you say check the package manager? what do you mean? I use apt BUT the drivers were downloaded from the site I posted and I manually put them into /usr/local/share/sigrok-firmwareI'm not at the machine right now but would like to check out your idea when I get home. What did you do to get pulseview working? I seem to have messed up somewhere?

author: hermit
author_rank: Frequent Contributor
timestamp: November 16, 2017, 06:42:15 pm
content: Debian has several graphical that are easy to search. I use Synaptic. I used Mandrake for years and was better with the RPM stuff when it came to command line. Ubuntu should have the same, but probably newer, package.https://askubuntu.com/questions/160897/how-do-i-search-for-available-packages-from-the-command-lineYou could try a symbolic link to the file locations I have listed above. Pulseview might not find them where you have them. Once I had everything installed I just had to choose my device from the drop down. Basically change it from demo. If you aren't seeing your device I have to think the system isn't finding the driver at the current file system location.

author: comicpilsen
author_rank: Contributor
timestamp: November 16, 2017, 07:00:14 pm
content: Hi hermitI'm going to go back and purge the current install and start from scratch. I'm going to track the lsusb output to make sure the thing is booting up as I have no lights on the hantek that I can see anyway. So I'm just going to download the drivers shove them into the same file location from your reply, download pulseview and see what happens. Am I missing anything please?thanks for your help

author: hermit
author_rank: Frequent Contributor
timestamp: November 16, 2017, 08:04:01 pm
content: Why not just use apt to install them? Both pulseview and the drive appear to be packaged?

author: comicpilsen
author_rank: Contributor
timestamp: November 16, 2017, 08:41:34 pm
content: Hey HermitI did install pulseview using apt (see below) BUT not sure what to search for to install the hantek? I've got pulseview/sigrok installed and the drivers downloadedotto@scope:~$ sudo apt search pulseviewSorting... DoneFull Text Search... Donepulseview/xenial,now 0.2.0-1.1 i386 sigrok logic analyzer, oscilloscope, and MSO GUI

author: hermit
author_rank: Frequent Contributor
timestamp: November 16, 2017, 09:43:45 pm
content: user@nevermore:/home/user# apt search sigrok-firmware-fx2lafwSorting... DoneFull Text Search... Donesigrok-firmware-fx2lafw/stable,now 0.1.3-1 amd64 Firmware for Cypress FX2(LP) based logic analyzers

author: comicpilsen
author_rank: Contributor
timestamp: November 16, 2017, 10:27:13 pm
content: hey hermitthanks so much for all your help but it still isn't working AND right now it's not showing up in the lsusb so there is more to do. I'm going to reload the whole machine and start from scratch. So just in case anyone else goes this way I will keep updating this thread until I get this working. Again thanks so much for all your great help. Here is what I am going to do1 reload Ubuntu from scratch2 sudo apt install sigrok-firmware-fx2lafw3 sudo apt install pulseviewHOPEFULLY this will undo any of the bollocks I have done to my system :-) you have really helped me out as has daybyter

author: hermit
author_rank: Frequent Contributor
timestamp: November 16, 2017, 10:58:57 pm
content: You might want to edit the title to have sigrok in the title. I found a page that lists what you should see even before the firmware is loaded. You sure the cable is good?https://sigrok.org/wiki/Hantek_6022BE/InfoThere is also some mention of software that I didn't need for my device which was a cheap USB logic analyzer.https://sigrok.org/gitweb/?p=libsigrok.git;a=tree;f=src/hardware/hantek-6xxx

author: comicpilsen
author_rank: Contributor
timestamp: November 16, 2017, 11:44:21 pm
content: Hey Hermitedited the top level topic to include sigrok and pulseview so others can find this thread in the future, again excellent suggestion.thanks for the bench check data and I'll see what happens post loaded it all.the cable is fine as someone has loaned me a windoze machine to check the hantek and I calibrated it using the same cable. To make completely certain I am loading Ubuntu from a usb stick in the same port I use for the hantek so I know that works as well.fingers crossed :-)

author: daybyter
author_rank: Frequent Contributor
timestamp: November 16, 2017, 11:48:24 pm
content: Do they still ship the usb cable with the 2 plugs with the scope? Did you plug them both in the usb sockets?You should see at least the usb id of the 'empty' scope then (with no firmware loaded).You might need those udev rules in the rules.d directory, so the loading of the firmware is triggered.https://github.com/rpcope1/Hantek6022API/blob/master/60-hantek-6022-usb.rules(I guess sigrok has similar rules?)

author: comicpilsen
author_rank: Contributor
timestamp: November 17, 2017, 12:01:23 am
content: Hey Daybytergreat to hear from you again.Yep, I have a single USB cable with one black and one red. I only plugged the black one in as that works on the windoze machine and to be honest I didn't see what the red one brought to the party, I suppose it could be power. when I get the os reloaded ( ubuntu 16.04.03 lts x68 as it's an old lenovo s10 ideapad I am using) I will try a few combinations including a powered USB hub I have found. I will try to see what the lsusb tells me before loading the firmware good benchcheck.not sure what you mean by the udev rules in rules.d directory? thanks for the link to them BUT what do I do with them please? Normally I just download the parts using apt and the various components are configured.thanks for the help as always

author: hermit
author_rank: Frequent Contributor
timestamp: November 17, 2017, 12:09:33 am
content: /etc/udev/rules.d

author: cdev
author_rank: Super Contributor
timestamp: November 17, 2017, 03:02:55 am
content: You should check their git repository and build and install sigrok from source if they have added anything you want recently.Say you want or need the latest and greatest sigrok functionality.Building from source is very very easy.For much hardware it may not matter. It depends.

author: daybyter
author_rank: Frequent Contributor
timestamp: November 17, 2017, 03:07:22 am
content: But even an older version should find the scope?

author: comicpilsen
author_rank: Contributor
timestamp: November 17, 2017, 06:17:06 am
content: hi allstill not seeing the scope BUT the lsusb is showing it's plugged in so SOME progress. Did the following as I said1 reload Ubuntu from scratch2 sudo apt install sigrok-firmware-fx2lafw3 sudo apt install pulseviewAND created a 60-hantek-6022-usb.rules file with daybyter's rules in it and put it into /etc/udev/rules.d/60-hantek-6022-usb.rulesrestarted the machine and started pulseview. only the demo machine is in the drop down and when I scan for devices with fx2lafw nothing shows up. I have plugged both the hantek USBs ( red and black) into a powered hub and tried that still nothing. The scope works fine on a windoze machine but under ubuntu 16.04.03 nothing. I'll keep plugging away at it so if anyone else has this issue I hope to be able to provide the solution.Cdev I'm with daybyter, if the old firmware doesn't help then I'm not sure how the new stuff would be any different. Hermit has this working so it's certainly my fault somehow but thanks for the suggestions

author: cdev
author_rank: Super Contributor
timestamp: November 17, 2017, 04:41:58 pm
content: I have a fully current install of sigrok with all the trimmings and I installed all of the software using "make install" however, looking in my /etc/udev/rules.d there is only one rule that pertains to sigrok, its the one that refers to my logic analyzers which I put there myself.You should download the source code for whatever software that talks to your device and read it and it will likely contain instructions on what, if anything is needed for udev.Udev seems to be going away soon. so you may be better off doing something else. This is an area I'm not so well informed on, but whenever I'm in a situation like this, the answer is always in that source code. Even if you don't know how to program or compile the code, still, download the source and read it for the info.

author: comicpilsen
author_rank: Contributor
timestamp: November 17, 2017, 04:47:57 pm
content: Hey Cdevgotcha on the current install of sigrok and given that I am now stuck, the apt install route didn't help. SO could you point me at the instructions you followed to get your environment working with a hantek 6022be and I'll give that a go. I am running an ubuntu 16.04.3 lts fresh install on a lenovo s10 ideapad. I want to use sigrok as it's what I use for my logic probes. I am a eev noob but know something about compters.thanks for the help

author: cdev
author_rank: Super Contributor
timestamp: November 17, 2017, 04:53:06 pm
content: You may want to install some of this software using "git"Start with your distributions documentation.. which is in /usr/share/* and /usr/share/docsMaybe you have a program like dwww that lets you read it using a web browser?You may find you want to use git anyway... or maybe an Ubuntu PPA, I think they have one.. Then you need to deinstall the other packages and use the PPA ones.. You'd have to add the PPA as a repository.But you have to make that decision for yourself. Don't mix packages installed by your package manager and source installs (what you can do using an Revision Control System like git..) until you know what you're doing unless you want to learn faster by breaking things, which is actually a good way to learn, but generally package systems are the easiest and not so far out of date if you keep them current. You could also create a deb or use the Ubuntu PPA, thats likely your best option.. Now you are probably really confused..Start here..https://sigrok.org/wiki/Hantek_6022BE"FirmwareIn order to use this device, the sigrok-firmware-fx2lafw (>= 0.1.4) firmware is required.The firmware was originally written by Jochen Hoenicke (see README for details), thanks a lot!Note: The firmware is not flashed into the device permanently! You only need to make it available in the usual place where libsigrok looks for firmware files, it will be used automatically (and "uploaded" to the Cypress FX2's SRAM every time you attach the device to a USB port).ResourcesVendor software and manualsopenhantek.org forum: Protocol info"--------I don't have a Hantek 6022be, however, you said your device needed to use the sigrok firmware at some point..Here is how to get it using "git"..git clone git://sigrok.org/sigrok-firmware-fx2lafwThat will create a directory,like this..Cloning into 'sigrok-firmware-fx2lafw'...remote: Counting objects: 1166, done.remote: Compressing objects: 100% (715/715), done.remote: Total 1166 (delta 708), reused 668 (delta 398)Receiving objects: 100% (1166/1166), 267.31 KiB | 238.00 KiB/s, done.Resolving deltas: 100% (708/708), done.where I see hantek_6022be.clets see whats in it..sigrok/sigrok-firmware-fx2lafw$ cat hantek_6022be.c/** This file is part of the sigrok-firmware-fx2lafw project.** Copyright (C) 2009 Ubixum, Inc.* Copyright (C) 2015 Jochen Hoenicke** This library is free software; you can redistribute it and/or* modify it under the terms of the GNU Lesser General Public* License as published by the Free Software Foundation; either* version 2.1 of the License, or (at your option) any later version.** This library is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU* Lesser General Public License for more details.** You should have received a copy of the GNU Lesser General Public* License along with this library; if not, see <http://www.gnu.org/licenses/>.*/#include <fx2macros.h>#include <fx2ints.h>#include <autovector.h>#include <delay.h>#include <setupdat.h>/* Change to support as many interfaces as you need. */static BYTE altiface = 0;static volatile WORD ledcounter = 0;static volatile __bit dosud = FALSE;static volatile __bit dosuspend = FALSE;extern __code BYTE highspd_dscr;extern __code BYTE fullspd_dscr;void resume_isr(void) __interrupt RESUME_ISR{CLEAR_RESUME();}void sudav_isr(void) __interrupt SUDAV_ISR{dosud = TRUE;CLEAR_SUDAV();}.........And lots more stuff - deleted for clarity..---------This is from the sigrok docs..Install the udev rules fileThese steps prevent the need to run libsigrok frontends as superuser.Copy the udev rules file from libsigrok/contrib/z60_libsigrok.rules to /etc/udev/rules.d/ (or where-ever your distribution stores udev rules files).Restart udev: sudo /etc/init.d/udev restart.Build fx2lafw$ cd sigrok-firmware-fx2lafw$ ./autogen.sh$ ./configure$ make$ sudo make installThis will install the firmware files into /usr/local/share/sigrok-firmware/, per default.If you use a package manager, likely it will install what you need.. if you use source, then you may have to install the udev rules yourself..Even if you use the packages you may still be missing something and have to install the udev rules yourself..You have to read the source, its not always plug and play.

author: comicpilsen
author_rank: Contributor
timestamp: November 17, 2017, 05:02:24 pm
content: hey Cdevthis is what I did last night BUT I will reload the whole machine and try again just to make sure. To be honest I think I might have got the wrong rules file as the ibsigrok/contrib/z60_libsigrok.rules isn't something I used. I want to try and fix this on the forum so others can see all the mistakes I make and avoid them. The help I am getting is tremendous thanks.

author: hermit
author_rank: Frequent Contributor
timestamp: November 17, 2017, 05:24:37 pm
content: I did say I had a cheap USB logic analyzer working with the firmware, not the Hantek.I'm not sure what this is all about but you may want to check it out. I'm not sure how it is used. My device 'just worked' after loading the driver.https://sigrok.org/gitweb/?p=libsigrok.git;a=tree;f=src/hardware/hantek-6xxx

author: comicpilsen
author_rank: Contributor
timestamp: November 17, 2017, 05:32:29 pm
content: hey hermitgotcha on the cheap logic probe I have the same for $5 from china and it worked right out of the packet with sigrok :-) I am now on a QUEST to get this Hantek 6022be working on software using linux, it works fine on windoze but...I am new to ee and want to go deeper with my raspberry pi's and all sorts of other things. You help has been wonderful and I thank you for it. I'm aiming to get this whole thing down to a single forum post where I can say I did this this and this and it worked.thanks again for all your helphugs

author: cdev
author_rank: Super Contributor
timestamp: November 17, 2017, 08:45:46 pm
content: Is there anything useful in your logs, (/var/log/*) dmesg (when you plug it in, whats added to it?) , or when you issue the command "lsusb"?"ls -lat" will list a directory showing the last modified files first.tail -f will show the end of a file that's being constantly added to.

author: comicpilsen
author_rank: Contributor
timestamp: November 17, 2017, 08:52:26 pm
content: Hey Cdevnext week I am going to reload the whole thing from scratch and take your approach ( 11/17/17 at 03:53:06 AM ) this thread. Using the ideas from daybyter and hermit I intend to document the whole thing for others. I'll include the logs, lsusb etc and the history of the bash so people can see what I got up to. This is no longer a task it's a fracking QUEST :-) (american vacation paraphrase)thanks for all your great help

author: abraxa
author_rank: Frequent Contributor
timestamp: November 17, 2017, 09:05:52 pm
content: You can run "pulseview -l 5" to see debug output on the console. There, you can see whether the hantek-6xxx driver recognizes any devices or not. If it's not recognized then PV won't show it in the dropdown.If you want to try thesigrok udev rules, then you can put these in your udev rules file:Code:# Hantek 6022BEATTRS{idVendor}=="04b4", ATTRS{idProduct}=="6022", MODE="660", GROUP="plugdev", TAG+="uaccess"ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="608e", MODE="660", GROUP="plugdev", TAG+="uaccess"You can see they also set the permissions and group values - not sure what the defaults are, so the rules you're using at the moment may be insufficient, I cannot say. If you want to use the sigrok udev file as-is, please make sure you rename it to 60_libsigrok.rules (i.e. removing the z) or else you may run into issues regarding the uaccess tag.

author: comicpilsen
author_rank: Contributor
timestamp: November 17, 2017, 09:17:53 pm
content: Hey AbraxaEXCELLENT ideas and I will certainly add them to my next week's attempt to get this working. I am not sure how to apply the udev rules as I have never really done that before, is it just a simple matter of putting them into a specific location and setting the permissions properly? ALSO the firmware, is there a specific location and permission set I should use? I want to make sure that the results of this are a text book step by step guide as to how to get Ubuntu working with sigrok on the hantek 6022 be on the lenovo s10 ideapad.thanks again for the excellent ideas

author: cdev
author_rank: Super Contributor
timestamp: November 18, 2017, 12:43:57 am
content: Why next week? You likely could get it fixed in just a few minutes.

author: comicpilsen
author_rank: Contributor
timestamp: November 18, 2017, 12:46:09 am
content: want to start from scratch, not near machine until Monday.

author: daybyter
author_rank: Frequent Contributor
timestamp: November 18, 2017, 05:50:23 am
content: Don't forget to reload udev after modifying the rules.

author: comicpilsen
author_rank: Contributor
timestamp: November 18, 2017, 12:06:58 pm
content: Hey daybyterthanks for the reminder and I always reboot after making mods to the system as I take a belt and braces approach to this stuff. I was going to run the command below to try it then reboot to make sure it sticks. Thanks again for all your help.udevadm control --reload-rules && udevadm trigger

author: abraxa
author_rank: Frequent Contributor
timestamp: November 18, 2017, 01:12:45 pm
content: Quote from: comicpilsen on November 17, 2017, 09:17:53 pmYeah, just check the files in /etc/udev/rules.d/ as you probably did before. Each file contains a set of rules and the numbering of the files determines the order in which the rules are applied. No special permissions are needed on those files.I'd worry about the firmware only if the PV debug output states that the firmware couldn't be found. Until then, simply installing the firmware package of your distribution should be enough.

author: comicpilsen
author_rank: Contributor
timestamp: November 18, 2017, 01:51:50 pm
content: will do abraxathanks for the extra info. For a EE noob all this is good practice. I don't remember the last time I had to configure something :-) I got lazy I suppose and this is teaching me alot. thanks to all

author: comicpilsen
author_rank: Contributor
timestamp: November 21, 2017, 11:12:17 pm
content: STILL no luck on this! I seem to be having REAL difficulty with the compiling of the sigrok firmware process. I'm going to start again from scratch. I MUST have missed something somewhere. The device is working on windoze and when I plug it in I can see it in lsusb. I have loaded the rules, restarted the machine just in case and still NOTHING on pulseview. I can't see anything in any of the logs SO it must me my approach to the driver build. I will keep working on this until I can produce a SINGLE forum post with each step itemized. Thanks all for your guidanceTHISis something I am doing wrong.have an excellent one

author: cdev
author_rank: Super Contributor
timestamp: November 21, 2017, 11:38:46 pm
content: You do know that the firmware is loaded onto your device at runtime, right?You should check out several of the videos by YouTube user "opentechlab" who is the author of Pulseview. Especially the first one. That will give you an idea of how both Pulseview and the FX2 /FX2LP chip it speaks to, work.Its definitely worth getting it working.Make sure you have removed ALL the debs and other files installed by your package manager AND have built and installed all the binaries if you want a source install.Don't mix the two!Since you've never had it working, it might make more sense to get it working from packages first, then if you need anything thats been added since the package you have was released, uninstall the packages and build it from source, making sure you have all the dependencies needed to do that. When you run "configure" it will tell you if it found all the pieces needed to build additional features successfully.Having both a package and a source install on the same machine is asking for trouble and in the case of sigrok, as far as I know here is no reason to do that. Nothing stopped working as sigrok got better.

author: comicpilsen
author_rank: Contributor
timestamp: November 21, 2017, 11:43:51 pm
content: Yep. Plug in USB then run pulseview NOTHING! just the "demo" in the drop down. Even scanning for devices no dice. It's certainly the way I am building the firmware as I am following TO THE LETTER the rule stuff. I'm going to scrub the os and reload and start a fresh. Ho hum...thanks for the idea though

author: cdev
author_rank: Super Contributor
timestamp: November 21, 2017, 11:56:25 pm
content: You just need to install one or the other.Since you're new to it just use your distro's packages.

author: comicpilsen
author_rank: Contributor
timestamp: November 22, 2017, 02:06:53 am
content: sorry I'm not sure what that means. I thought I had to download the firmware, put it in a location, put the rules in a file and put the rules file in another location. Plug in the device which would trigger the rule which would load the firmware. download pulseview and run it. Did I miss something?

author: cdev
author_rank: Super Contributor
timestamp: November 22, 2017, 02:58:59 am
content: Do you have Synaptic installed? Launch Synaptic check that you have no sigrok packages installed, if you do, remove them, thenIf you have installed any linux binaries, delete them completely.if you have installed any source installed (by "make install" go into the directory you typed that and instead type in sudo make uninstall, then double check in /usr/local/bin /usr/local/lib and /usr/local include to make sure you got them all.."; do an "apt-get autoremove" after uninstalling the ubuntu sigrok packages - otherwise the PPA may be ignored)"Then and only then, plug the data below (for the sigrok.org PPA) into "repositories", then reload.https://launchpad.net/~daniel-elstner/+archive/ubuntu/sigrokthen search on "sigrok" using names and descriptions as the fieldYou will see new sigrok packages, install them all, unless they conflict with one another.Apply the changes..Then type in "sudo ldconfig" Then see if you can finally run sigrok.

author: comicpilsen
author_rank: Contributor
timestamp: November 22, 2017, 05:31:21 am
content: no I don't have synaptic installed I use vanilla apt.I don't have anything installed as I am completely blasting the system everytime I try this. It's takes about 10 minutes to reinstall ubuntu from scratch so there is nothing left.will do on the PPA in repositories BUT the firmware seems to be a version I can't use. I need sigrok-firmware-fx2lafw (>= 0.1.4)I read this in your previous instructions."FirmwareIn order to use this device, the sigrok-firmware-fx2lafw (>= 0.1.4) firmware is required.The firmware was originally written by Jochen Hoenicke (see README for details), thanks a lot!thanks again for taking the time on this.

author: abraxa
author_rank: Frequent Contributor
timestamp: November 22, 2017, 11:03:26 am
content: Quote from: comicpilsen on November 21, 2017, 11:43:51 pmRemoving the entire OS just for this? I think you're going a bit too far, there's no need for this. I think a systematic approach works better.For example, did you run PV with the "-l 5" parameter to see what happens when it scans for the devices? If so, please show us what it says.

author: comicpilsen
author_rank: Contributor
timestamp: November 22, 2017, 12:17:10 pm
content: Hi abraxaYep the os reload is a nothing thing, takes about 20 minutes start to finish. My goal is to come up with a final post to this topic where I can just say "loaded ubuntu 16.04.03 then..." so people can do what I am trying to do which is use an old laptop. I did run pulseview with the -5 parameter, ( I purged it last night when I reloaded the os) when I looked at it it didn't seem to be looking for the santek 6022be firmware at all. Next time I will pipe the output into a file an post it but I don't like bothering people too much. I'm going to reload everything from scratch and make sure I am following the instructions to the letter. I am certain this is my fault somehow and you kind people have given me all the help I SHOULD need to get this done. I'm hoping to help the next noob who comes along :-) I will make every effort put out the relevant log entries as well. Part of this is I am not convinced the firmware is being put in the correct directory, this time through I am going to check all the config files to make sure. I took the vanilla approach hoping with a fresh os all would be well BUT nope. Thanks again for the help on this.

author: cdev
author_rank: Super Contributor
timestamp: November 22, 2017, 01:19:07 pm
content: You should read up a bit on how the concept ofreleases, packages (in your case debs) and packagedependencieswork. Each release is frozen before it is released. Using aknown good setof packages.So that it doesn't getby upgrades.

author: daybyter
author_rank: Frequent Contributor
timestamp: November 22, 2017, 02:37:14 pm
content: So it seems there are at least 3 different firmwares?The hantek one.The one from Jochen HoenickeThe sigrok firmwareEach of these firmwares will use a different USB id, when it is loaded into the scope. Pulseview will only start, if it sees a device with the sigrok USB id.So check with lsusb what USB devices you have. Make sure, that the sigrok firmware is loaded, before you move on.

author: comicpilsen
author_rank: Contributor
timestamp: November 22, 2017, 02:55:20 pm
content: hey both cdev and daybyterI get the way the releases happen in linux, that's not my problem. I don't seem to be handling the separation of the firmware approaches properly and half assing it. SO here is my dedicated approach SIGROK all the way! I am going to concentrate on getting that approach right from scratch. daybyter is right, the output from lsusb says the chip is being detected but the firmware is NOT being located by pulseview. SO it's sigrok all the way AND, thanks to you GREAT people, have all the tools I need. Thanks as always

author: cdev
author_rank: Super Contributor
timestamp: November 22, 2017, 03:15:43 pm
content: The specific device firmware has to be where it can be loaded by the fx2 program when required. So sigrok cli, pulseview, etc. libsigrok, libsigrokdecode, can communicate with the various hardware.Its not just one program you need, its an entire ecosystem.When you install via a package manager and GUI like synaptic you can pull in all the dependencies and you should install the "recommends" too unless its clearly only needed for some hardware you don't possess.Read the text that pops up in the little window - make sure synaptic is set to show you them.Then read the docs they put in your docs directory. You can also set apt to send you, the root user, email containing all the things you need to know to get the softwar you just installed working..

author: comicpilsen
author_rank: Contributor
timestamp: November 22, 2017, 03:21:02 pm
content: yep I get that. I get that I have to load the whole ecosystem ( nice touch that) and following the instructions from the sigrok link I thought I had I did that BUT clearly nope. I watched the videos on youtube and they were GREAT. Thanks for pointing them out. I did use apt to install and thought it would bring in all the dependancies and put them where necessary but obviously I broke something. Will try again but this time concentrate more on the logs.

author: cdev
author_rank: Super Contributor
timestamp: November 22, 2017, 03:24:41 pm
content: You said you plan to write it up? You should wait a while, because the things you may conclude early on may be seen quite differently by your future self, assuming you persist in learning Linux which is very very much worth it. Linux is a real pleasure to use once you devote some quality time to learning it. You yourself have to put in that effort, we cant do it for you.I think that you should pay great attention to daybyters suggestion that your several installs may be conflicting with and/or blocking one another.You should remove everything thats been installed related to the Hantek and start fresh with one program set and one package installation method.This means - read the docs - Linux has an entire directory /usr/share/doc where programs save documentation. Not just docs about one program, docs about how to install software and the things you need to know to understand documentation.Read all the docs that are supplied with software and if you run into problems also read the source which often has reams of additional information. Some software has little documentation written and the authors assume that users are smart enough to know to read the source.pay particular attention to permissions. In order to access a USB device, the user has to have the correct permissions. the udev rules will contain group names which have to map to a group the user is in or the users name. (each user has their own group) One popular sort of a catchall group for USB devices is "plugdev". Some applications may have their own group name. I could also some users creating generic test equipment group name.To use USB devices attributed to a group, (and what user and group owns them with what permissions - you can see when they are plugged in by watching the links which appear when you list using ls -lat the contents of the /dev/ directory)Also, when you plug in a USB device, it should enumerate certain information in the "dmesg" (sudo dmesg will show this) and will show up when you type "lsusb"Could you post information on what gets shown up with commands like that also what is returned when you list the contents of the /dev directory after you have reinstalled one of the several programs you are trying to use. Just start out with one. Sigrok would be fine. Also remember that sigrok is a collection os several programs, not just pulseview or whatever. You know that, but it cant hurt to hammer it in. As far as getting the most recent versions of everything and completeness the PPA is probably your best bet, but that means you need to before you use that remove all the ubuntu packages, remove all the binaries you've put anywhere, remove any and all source installs, by using "make uninstall" in the same directory you installed them from. Then check /usr/local/* for any that remain using ls -lat to show the recent additions at the top. delete everything you installed as part of this hantek project, first, and only then - reinstall it all from the PPA. Using synaptic. Okay?The programs available from a repo at a given instant in time all play well together, thats the idea.Mixing install methods, mixing programs, that will depend on the same HW and likely block one another,is guaranteed to cause problemson any OS, frankly.

author: lundmar
author_rank: Frequent Contributor
timestamp: November 22, 2017, 04:58:37 pm
content: It would have been much easier for you if you could have used one of the sigrok Ubuntu PPAs. Unfortunately they all seem to be quite unmaintained / out-of-date despite the sigrok git repositories being actively updated. You could try contact one of the Ubuntu PPA maintainers to see if they would like to update. Alternatively, you can build manually but it can be a somewhat painful path as there are many dependencies and versions to manage.

author: cdev
author_rank: Super Contributor
timestamp: November 22, 2017, 05:11:47 pm
content: Lundmar sounds like he has just checked, he's likely right, then I would just go with the ubuntu debs. Do everything I suggested erase the other programs, even uninstall any debs you added previously, reload your repos in synaptic then install ubuntu sigrok everything. It wont let you install two programs that conflict with one another. Debian and other deb based distros like Ubuntu are great for that. Its a HUGE time saver.

author: daybyter
author_rank: Frequent Contributor
timestamp: November 22, 2017, 06:21:47 pm
content: And make sure, you remove all udev rules, that might have added manually. Pulseview does not load the firmware, it is the udev daemon. So even with a removed sigrok it might load the wrong firmware (or will try to at least).But you can always see a loaded firmware with the lsusb command.https://unix.stackexchange.com/questions/36251/in-which-log-should-i-check-for-udev-errorsThis might help you to understand what udev is doing.

author: comicpilsen
author_rank: Contributor
timestamp: November 23, 2017, 12:40:41 am
content: so trying to get the firmware and keep getting this error. I know the machine is attached to the web as I can ping 8.8.8.8 and use the browser. I am using SU hence the # and I have triple checked the command is corrent. Anyone see what is wrong with it? This is a completely fresh install.git clone git://sigrok.org/sigrok-firmware-fx2lafwCloning into 'sigrok-firmware-fx21afw'...fatal remote error : access denied or repository not exported /sigrok-firmware-fx21afw

author: hermit
author_rank: Frequent Contributor
timestamp: November 23, 2017, 01:00:39 am
content: I started having problems with git a while back on Debian. After a while it started to get annoying so I checked around. I guess this isn't too uncommon and no one seems to have a good answer. Try jgit. It is a java implantation. Kind of annoying because this seems to affect lots of people and has never been solved.

author: cdev
author_rank: Super Contributor
timestamp: November 23, 2017, 01:18:19 am
content: Don't use the git anything unless ubuntu's instructions tell you you need a firmware blob/

author: lundmar
author_rank: Frequent Contributor
timestamp: November 23, 2017, 02:35:42 am
content: Quote from: comicpilsen on November 23, 2017, 12:40:41 amNo problem here. Running git v2.15 . Make sure you are running a recent version of git and that your network is not somehow restricted.

author: comicpilsen
author_rank: Contributor
timestamp: November 23, 2017, 02:37:17 am
content: Hey cdevtrust me I didn't want to have to do this but nothing else seems to work. I apt installed the components NOPE! I tried to download the firmware prebuilt NOPE! so finally I am going down the path in the link below. Up until the firmware install all was going swimmingly! Ironic really, one last defeat snatched from the jaws of victory :-) I can't find anything on google that tells me what is causing the git error as all the others worked fine. I am loathe to apt install the firmware given I have built all the other components from scratch AND this error is bugging me because I don't know how to fix it.here's the steps I am following.https://hackaday.io/project/21056-building-sigrok-on-linux-mint

author: cdev
author_rank: Super Contributor
timestamp: November 23, 2017, 02:41:44 am
content: Why don't you use the ubuntu debs, I thought you were on ubuntu. You should still be able to use them if you are on mint.Don't deliberately make things difficult for yourself.

author: comicpilsen
author_rank: Contributor
timestamp: November 23, 2017, 02:42:10 am
content: hey lundmarI just reloaded the os and ran sudo apt update and sudo apt upgrade so YEP running the latest git. All the other gits I ran leading up to this worked fine. I am the owner of the network so no restrictions at all BUT what would I be looking for please? I have tried to run the command as SU and not as SU. ANY HELP would be appreciated.

author: comicpilsen
author_rank: Contributor
timestamp: November 23, 2017, 02:45:08 am
content: I am on Ubuntu but the apt approach didn't work at all. The approach for Mint should be exactly the same as for Ubuntu as they are both Debian based aren't they?

author: lundmar
author_rank: Frequent Contributor
timestamp: November 23, 2017, 02:58:17 am
content: Quote from: comicpilsen on November 23, 2017, 02:42:10 amTell us what git version your are running:Code:$ git --versiongit version 2.15.0Try run git with verbose output, it might tell if it is a protocol or network related error, I bet the latter.Code:$ git clone -v git://sigrok.org/sigrok-firmware-fx2lafwCloning into 'sigrok-firmware-fx2lafw'...Looking up sigrok.org ... done.Connecting to sigrok.org (port 9418) ... 88.99.77.186 done.remote: Counting objects: 1166, done.remote: Compressing objects: 100% (715/715), done.remote: Total 1166 (delta 708), reused 668 (delta 398)Receiving objects: 100% (1166/1166), 267.31 KiB | 1.61 MiB/s, done.Resolving deltas: 100% (708/708), done.

author: comicpilsen
author_rank: Contributor
timestamp: November 23, 2017, 05:28:55 am
content: so git is version 2.7.4 AFTER running apt update and apt upgrade. I am running ubuntu 16.04.03 i386.iso please see below that even with git verbose same thing happens. All the other git commands worked fine.dave@probe:~$ git --versiongit version 2.7.4dave@probe:~$ git clone -v git://sigrok.org/sigrok-firmware-fx21afwCloning into 'sigrok-firmware-fx21afw'...fatal: remote error: access denied or repository not exported: /sigrok-firmware-fx21afwdave@probe:~$

author: smithnerd
author_rank: Regular Contributor
timestamp: November 23, 2017, 05:54:57 am
content: fx21afw?Numeral 1 should be lower case L. That old chestnut...

author: comicpilsen
author_rank: Contributor
timestamp: November 23, 2017, 05:59:42 am
content: hi smithnerdwelcome to the nightmare :-) I hope you are right but right now I am away from the machine. Thanks for pointing that out. When I get back I'll triple check. THIS could be VERY embarrassing :-)

author: comicpilsen
author_rank: Contributor
timestamp: November 23, 2017, 11:04:42 am
content: hi allso in USA we celebrate thanksgiving today, my thanks go out to daybyter,cdev,hermit,abaraxa and smithnerd for helping me on this quest. I FINALLY, early this morning, got this done and tested! In the end I had to take a long and laborious path. I would have much preferred to use the APT install approach but it didn't work at all for me on the hantek6022be. SO I finally took everyone's advice, flushed the os completely, reloaded and took the path in the link below which documented the approach WAY WAY WAY better than I ever could. In short this has been a wonderful experience and I have learnt so much thanks to the people above, the unsung heroes of the web. Thank you all and thank you smithnerd for the "1" vs "l" observation and not sniggering :-) thanks allcomicpilsenhere is the process that workshttps://hackaday.io/project/21056-building-sigrok-on-linux-mint/details

author: lundmar
author_rank: Frequent Contributor
timestamp: November 23, 2017, 11:59:29 am
content: Quote from: comicpilsen on November 23, 2017, 05:28:55 amHmm. This means that you are running Ubuntu 16.04 LTS. I would like to point out that unless you are running some sort of machine used for production, then there is absolutely no good reason for running such an old version of Ubuntu. I recommend you always install the latest version, in this case Ubuntu 17.10, especially if you are trying out new software and it does not work as expected. Latest Ubuntu includes latest software features and bug fixes and it might have worked better for you in case of sigrok.However, good job getting it installed manually - it's a good learning experience. By the way, I literally copied your original git clone string so you must have been really unlucky messing up '1' -> 'l'One thing to notice regarding the sigrok manual install instructions is that they are installing sigrok as super user. This is generally areally bad ideabecause you will overwrite the systems original sigrok installation and if you really mess up during any of the installation steps you can ultimately end up destroying your system. If you do have to install anything manually it is highly recommended to install to your home directory as a normal user e.g. like so:Code:# ./autogen.sh# ./configure --prefix=$HOME/opt# make# make install

author: hermit
author_rank: Frequent Contributor
timestamp: November 23, 2017, 03:04:34 pm
content: Quote from: smithnerd on November 23, 2017, 05:54:57 amI learned to type on a manual typewriter. About a year ago I accidentally 'reverted' and of course it had to be one of the few times I was doing code.Edit: I guess I shouldn't assume many, if any, will get the reference. There was no 1 on old manual typewriters. You used the lower case L.

author: cdev
author_rank: Super Contributor
timestamp: November 23, 2017, 04:44:32 pm
content: So now you can start having fun with it! Check out youtube user opentechlab's videos, starting with the first one, which is a good intro to pulseview and sigrok..

author: cdev
author_rank: Super Contributor
timestamp: November 23, 2017, 05:06:50 pm
content: When you install sigrok the way they suggest it writes everything to /usr/local which is only non-package-managed stuff. Normally I uninstall packages of something before installing something from source. You can also install as you say to a prefix in your own home directory but then you have to add that directory to the relevant environmental variables in your .bashrc or similar. The .bashrc is a "dotfile" that means that it has a dot at the beginning of its name and so is not usually shown when you list the directory unless you tell the ls command to with something like an -a" flagYOUR dotfiles in your home directory (abbreviated "~") are configuration files which get read upon launching of applications by you, not by any other users on your machine.The .bashrc is particularly important because everything in it is read in upon creation of a new shell to initialize its "environmental variables". Many variables may also be inherited from a higher level and then you modify them as you get more specific. You should get a good starter document on bash, maybe start with your computers own man page man bash. But you should also look at your distro's beginner documentation where you will likely find a number of free beginners guides to bash scripting. Setting your environment by use of lines in the .bashrcand other .bash* files is how you will customize your shell prompts, set up aliases, short abbreviations for frequently typed commands and so on.But for now you just want to ensure that the stuff you tell to install itself into ~/opt or wherever you put it gets seen when you type "pulseview" or whatever... It will be put in directories like ~/opt/bin~/opt/lib ~/opt/include ~/opt/share/doc and so on.. but those directories have to be "prepended" manually to the appropriate variables at the beginning using bash's syntax. That might look a bit like this;PATH=/home/yourusername/opt/bin:${PATH};export PATHYou might also need to do something similar for LD_LIBRARY_PATH and if you plan to compile software against your new other software (not recommended at this point) similarly prepend your include directoryThe colon separates the different parts, the part before the first colon :${PATH} just sticks in what the path is to your directory and the second part inserts the value before your changes here.. the semicolon says evaluate that, then "export" says use this for everything thats done with this shell.You can see what these environmental variables are at any given moment by typing in the command "env" You'll see that they vary depending on what you do with your .bashrc which effects almost all of your other files,You can set up other dotfiles for when you want to initialze some set of variables say you want to run different versions of software you can set up a variable set for software youve compiled yourself that prepends your directories and not use that set of variables when using plain vanilla debs.So to recap, there are several environmental variables you will need to add for your new opt directory to work, one will be your "$PATH" which is the order within which directories full of binaries are checked when you type a command. generally, you want your own versions of things to be selected preferentially when you have added something so you want your own directories to show up earlier in the "$PATH" when you type env In the simplest possibe source installs the bin directory needs to be added to the path and the LD_LIBRARY_PATH needs to be added to the shared library search path, at the beginning in the same way.Later on you can start doing more with this.. You can also set up "wrappers" which launch other programs with specific setup variables.. or multiple versions of the same program compiled with different options.. or different other libraries.For example you can use "wrapper scripts" to invoke software with a speific library instead of the defaults. by typing "LD_LIBRARY_PATH=/thepathtothelibrarydirectory" in the same line before the commandIn my case, this ".bashrc" file easily gets out of hand and becomes a huge file if I let it so I break it up into a bunch of smaller files for different applications and leave the invocations to those other files commented out with a pound signYou should start by looking at the default .bashrc that ubuntu gives you and add to that.look for how various people do it.Quote from: lundmar on November 23, 2017, 11:59:29 am

author: lundmar
author_rank: Frequent Contributor
timestamp: November 23, 2017, 07:21:24 pm
content: Quote from: cdev on November 23, 2017, 05:06:50 pmGenerally I don't recommend cluttering your .bashrc to do any type of software compilation but rather use the appropriate autotools configuration variables during compilation/installation.I didn't elaborate on the details of how to install to a prefix in $HOME, in particular to avoid running anything as super user, because it can be a little challenging to a new guy. However, for those interested, here is a good example of the install techniques that will work for most source packages with proper autotools support:Code:sudo apt-get install git automake autogen autoconf libtool libreadline-dev libc-dev-bin libc6-dev libavahi-core-dev libavahi-common-dev libavahi-client-devmkdir lxi && cd lxigit clone https://github.com/lxi/liblxi && cd liblxi./autogen.sh./configure --prefix=$HOME/opt/lximake installcd ..git clone https://github.com/lxi/lxi-tools && cd lxi-tools./autogen.sh./configure --prefix=$HOME/opt/lxi LDFLAGS=-L$HOME/opt/lxi/libmake CFLAGS=-I$HOME/opt/lxi/include installcd ..export PATH=$HOME/opt/lxi/bin:$PATHExample is taken fromhttps://www.eevblog.com/forum/testgear/open-source-lxi-tools-and-liblxi-v1-0-released-for-gnulinux/msg1318434/#msg1318434It basically installs an application (lxi-tools) and its dependency library (liblxi) using the variables I speak of. No touching any files except for maybe, in the end, expand the PATH variable in .bashrc to include your custom install location.

author: cdev
author_rank: Super Contributor
timestamp: November 23, 2017, 08:59:54 pm
content: Thank you!The basic stuff you will be doing in your sleep before long comicpilsen..At the end, add the bin directory to your path so you can just type the program name and have it seen.Otherwise you can still run it but you have to use the full path to the program executable itself.The last line is where lundmar shows you how to write the minimalistic .bashrc addition, its not supposed to be copied verbatim.It is good to not clutter your .bashrc, I agree."export PATH=$HOME/opt/lxi/bin:$PATH"

author: lundmar
author_rank: Frequent Contributor
timestamp: November 23, 2017, 09:49:18 pm
content: Quote from: cdev on November 23, 2017, 08:59:54 pmHe he, no worries!Quote from: cdev on November 23, 2017, 08:59:54 pmExactly, and if you want to take it to the next level you simply add the line:Code:source ~/.pathto your .bashrc and in the file named .path you can clutter as much as you like with stuff like this (example):Code:export PATH=$HOME/opt/xz/bin:$PATHexport PATH=$HOME/opt/tio/bin:$PATHexport PATH=$HOME/opt/tmux/bin:$PATHexport PATH=$HOME/opt/git/bin:$PATHexport PATH=$HOME/opt/tar/bin:$PATHexport PATH=$HOME/opt/lxi/bin:$PATHexport PATH=$HOME/opt/vim/bin:$PATHThis is basically the only modification I make to my .bashrc with the exception of modifying my bash HISTSIZE and HISTFILESIZE to 10 billion lines history lengthOn a general note, it is a good idea not to mess with any system files. This way your system installation will likely survive much longer. In my case I'm running an Ubuntu system which has survived 10 Ubuntu release upgrades and I'm pretty sure that is because I'm very careful not to touch system files except the occasional PPA which can always be rolled back because it is consistently handled by the package manager.

author: cdev
author_rank: Super Contributor
timestamp: November 26, 2017, 02:38:14 am
content: Comicpilsen, if you go to raspberrypi.org and look at the "MagPi" magazine's free downloads, there you will find a free BOOK on Bash scripting for beginners. As well as more than 50 issues of their magazine which is chock full of cool Linux stuff to do much of which you can ALSO do on Ubuntu or Mint, and a bunch of other stuff thats free that I found useful including a bunch of book-sized publications on cool Linux projects that support Raspberry Pi hardware (which is quite affordable) and electronics. Its really quite a high quality effort, nothing like it is even remotely comparable. MagPi is a jewel among free documentation for projects - its a free download, all their PDF magazines with lots of interesting projects all using open source software.https://www.raspberrypi.org/magpi-issues/?C=N;O=A