onsdag den 25. juli 2012

D-Link SharePoint for Ubuntu

So I bought a new router and this one is a D-Link DIR-657 and it has one has the abillity to have a usb printer or harddisk connected to it. Something I would like to use, but there is a problem I'm using Linux, since there is no software for it from D-link and no help from D-link (non that I could find), I began to search for an answer to get it working on Ubuntu.

I first found an forum post, that tried using FTP to access it, and from what I could read, they could'nt, but they had found some other post about it [Link 1] [Link 2] . The second link gave the most answer, it seams that the protocol used by the SharePoint software, is supported by smbclient and therefor can be connected to it by using smbclient.

First I tried to connect to it as the second link says
smbclient -L
But I got this reply from the router
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.24]Server requested LANMAN password (share-level security) but 'client lanman auth = no' or 'client ntlmv2 auth = yes'tree connect failed: NT_STATUS_ACCESS_DENIED
So what to do other than read some documentation on smbclient, I found that by adding "-U" you could connect to is as an user, so I tried this also
smbclient -L -U admin
But I got the same reply as before, then back to the documentation, found that by adding an "-N" instead of an "-U" you could specify that no user, that had to be tried
smbclient -L -N
 And success, I got the list of devices on connected to it
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.24]

Sharename       Type      Comment
---------       ----      -------
usb(A1)         Disk      Device(us) (LaCie,LaCie Device)
IPC$            IPC       IPC Service (D-Link DIR-657)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.24]

Server               Comment
---------            -------

Workgroup            Master
---------            -------
So now I wanted to connect to it, after installing cifs-utils (sudo apt-get install cifs-utils), I could mount it in a folder in my home directory.
mkdir $HOME/SharePoint
sudo mount.cifs //\(A1\) $HOME/SharePoint/
Then so I added an file, and unmounted the directory looked at it, no file, mounted it again and the file was there, so It worked.
Now I would like to have it mounted at boot, then we need to add it to the fstab file. Since I can't remember how to do this, I found a site that contained this information [Link 3]
# Network hdd on D-Link
//\(A1\) /home/kaalund/SharePoint cifs _netdev 0 0
Next to mount it, one could either reboot or use the mount command "sudo mount -a".

So whats next, that somebody add a scripts that can do this from nautilus when a device like this on the network. But I don't think it is going to be me.

mandag den 12. marts 2012

Hierarki Blocks in gSchem

So, hierarki block in gschem, is not that easy as in other EDA tools.
First you have to create the subcircuit, and then you have to create the symbol, that you then can put in your overview circuit.

This is a feature that is quite useful, as then you can create a modular circuit, this mean that if you have a circuit that you will reuse, or if you just want a better overview over of your diagram.

For example, take a look at the gTAG circuit from the geda-example package on my machine it is located, at /usr/share/doc/geda-examples/examples/gTAG :
Of course I use this example, because this a uses hierarki block schematic, but as you can see this is useful when you have a big schematic, to put you circuit into smaller section. Or if you just want to reuse an "old" schematic.
The blocks attributes is shown on the following picture:
As we can see it has an attribute called "source" which directs it to "gTAG-psu.sch", this directs the gschem to the circuit represented by the symbol called, "gTAG-psu".
So if we want our schematic to have this hierarki blocks, then we need to create a symbol and a schematic before we can add it the overview schematic.
Hopeful some day, an feature to gschem is added, so you just can draw an square, slap some pins on it and it will create the symbol and underlying schematic, with the inputs and output in it.

But until further, I have created a script that, takes an schematic and creates a block symbol from it. There is some limits on this scripts, so I will name them here:

  • Use of symbol: "in-1.sym" to indicate a input port
  • Use of symbol: "out-1.sym" to indicate a output port
This scripts, will create a file called "yournameofsch.src", this file is a tragesym file, that then is need to be put through "tragesym" to create the symbol for your circuit.
Add this symbol to your schematic, open the attributes for this symbol, and add "source=yournameofsch.src" to it. This is so that it points to your circuit. 
Then you should be done, do this for all your subcircuits.

Just a warning, this script is not mean to be a permanent solution, this is only a temporary solution for this. I am also currently working on a new version, that does not rely on "tragesym" to create the symbol, but could take awhile before this is done.   

Hopes this help somebody