Enable Wake Up by Keyboard/Mouse on Arch Linux

Posted by in Linux

The power button on my pc case is not very handy to work with, which made waking up by mouse/keyboard an awesome idea. The first thing to achieve this is obviously, getting inside bios and enable the wake up option for keyboard/mouse, LAN or whatever you like. You probably at this step expect that things get to work out of the box.

Well…. probably no. but still you got chance. from my experience some device works out of the box and some simply don’t. why? I think because they are a little too complicated for ACPI to handle them. Here I summarize my workaround to get these kind of devices work.

Step 1: Find device path

First of all you need to find device path. Device path is both the way that the device is connected to your computer and also the way you can access your device settings on your computer. To get this path, all you need is to find your keyboard/mouse node on /dev path and feed it to udevadm. As an example for my keyboard executing something like

udevadm info -q path -n /dev/input/event0

give this path and for mouse executing

udevadm info -q path -n /dev/input/mouse0

Step 2: Find your lucky wakeup file

Next you need to surf on your device path and find a file named wakeup. it may be in your device path/power. if not look it parent directory and foreword until you find the right file. For example in my case, wakeup file turned out to be /sys/devices/pci0000:00/0000:00:14.0/usb1/1-13/power/wakeup. Then you should write enabled inside this file by running

sudo sh -c "echo enabled > '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-13/power/wakeup'"

If you are standing on a right place then probably double clicking cause your pc to wake up after suspension. if not try to looking the parent folder.

Step 3: Make The Process into Auto mode

As you know udev let you run script if specific device connected to the kernel, we exploit the idea and enable wakeup for our little cute mice.

SUBSYSTEM=="usb", ATTRS{idVendor}=="1b1c", ATTRS{idProduct}=="1b19" RUN+="/bin/sh -c 'echo enabled > /sys$env{DEVPATH}/../power/wakeup;'"

Hope You Enjoy

Install ADS 2015.01 on Arch Linux

Posted by in Electrical Engineering

Advanced Design System officially support RHel 5, RHel 6 and Solaris 10. My desktop use ARCH Linux, which is not listed in the support platforms. So some steps have to taken before get ADS to work. Here I summarize my walkaround on installing ADS on Arch Linux platform which it may or may not be possible to applied on any distribution other than Arch.

Installation Steps:

  1. Install ADS on your PC using shell script. Keep in mind that Install ADS on a path with no white-space or special character, although ADS setup does not complain, this cause fatal error in ADS runtime.
  2. From try and error it seems that ADS use Qt 4.8.6 which is have minor changes that make it incompatible with Qt4 provided from arch repository. Fortunately Qt 4.8.6 is packed inside ADS path, so it can be readily used by adding it to LD_LIBRARY_PATH environment variable.
    Edit LD_LIBRARY_PATH in <ADS_PATH>/bin/ads

  3. Create a duplicate from and rename it to in <ADS_PATH>/SystemVue/2014.10/linux_x86_64/bin/MATLABScript/sys/os/glnxa64. This may seems weird, so just to be clear out libXm is for Solaris platform (desktop environment). We create this file just to prevent from linking error which is not cause any further problem as while as the running platform is not Solaris.
  4. Install  Dependencies which is needed by License ManagerADS software.
    sudo pacman -S lsb-release libxp
    yaourt ld-lsb
    yaourt ksh
  5.  Run <ADS_PATH>/bin/ads

License Setup:

HostName: the computer name can be achieved by running following command

$uname -a 
 Linux Bijan-PC 4.4.7-1-lts #1 SMP Thu Apr 14 17:26:39 2016 x86_64 GNU/Linux

which is revealed that my HostName is Bijan-PC
There is no MAC Address need for Linux platform on the other hand ADS use so-called CPUID which generate based on your platform which can be used to get license file from KeySight Corporation. CPUID, MAC and HostID are all the same. note that HostID is different from HostName

How to Program Cortex M under GNU/Linux Arch

Posted by in Hobby Electronic, Linux

You may serach out all sites but there isn’t any adequate context in this subject. ARM family is a new platform that it’s compiler and other toolchains also matured recently so unfortunately there isn’t much quick start guide available out there. Here, I try to fill this gap and give you a hint about how to begin developing your fresh ARM-based board under GNU/Linux. Throughout this tutorial I work out with STM32F4 Discovery development board and Arch Linux distribution. If your board or your distribution is different don’t worry, with a little efforts all steps can be applied into your case.

Required tools:

sudo pacman -S arm-non-eabi-gcc

After installing toolchains you need to download CMSIS library for your microcontroller. CMSIS is a vendor based library, written to interface CPU and peripherals control register in a delicate manner. In our case, ST Microelectronic CMSIS library known as STMCube F4, can be downloaded from STMicroelectronics webpage.

Each stm32 device carry out with a two user manual so-called Programming Manual and Reference Manual. Reference Manual address to each peripheral registers and unit description. On the other hand Programming Manual show how to employ interrupt and hook up booting process. Both these manuals are essential in programming ARM microcontroller so ensure to have them before you start.

Unfortunately for the time being I’m busy to write down full guide on programming Arm Coretex M. so if you are in hurry to get things to work you can checkout our git repository for a clean and simple blink LED project. please keep in mind that follow all above steps and check ReadMe folder in the repository befor jump into the final stage.

Hello world!

Posted by in Casual

Hello, My name is Bijan Binaee. I’m an Electrical Hobbyist/Engineering enthusiast, currently studying electrical engineering at ECE School of University of Tehran .
You have found my little corner on the Internet.  This division includes lots of work on making things to work from simple blink LED to interfacing CSI camera capturing fowl movements.
I enjoy analyzing systems with complex interactions, and this has led me to delve the depths of Linux Kernel, GTK and other softwares.
Today is Easter Saturday. Not a day marked on most calendars.
But it is a very important day nonetheless, the day that I sit in my office, think about a question in my mind and spend hours to fulfill it no matter what. So if I have a little luck with me I found answer and wrote it all down to here.

Hope you enjoy,

Recent Comments