#avr | Logs for 2016-08-03

Back
[03:27:58] <Bomber4Chats> yo
[03:28:17] <Bomber4Chats> Looking for USB drivers to work with an ATXmega
[03:28:22] <Bomber4Chats> in Linux
[03:36:05] <_ami_> Bomber4Chats: it should work without installing any drivers on linux
[03:36:27] <Bomber4Chats> OK
[03:36:39] <Bomber4Chats> so I'm not sure how to connect / telnet to the HID
[03:45:20] <_ami_> well connection depends upon the mode of connection
[03:46:01] <_ami_> you could check device type \by issuing dmesg -wH and disconnect and connect the xmega
[03:46:14] <_ami_> Bomber4Chats: ^
[04:10:22] <Bomber4Chats> Ok, I'll check that soon
[04:35:59] <_ami_> Bomber4Chats: and to communicate with USB devices, you need libusb
[04:36:11] <Bomber4Chats> that I have
[07:15:07] <Bomber4Chats> OK, I'm back on Linux :)
[07:15:29] <eszett> hi! I have a question
[07:16:32] <Bomber4Chats> This is what I get:
[07:16:33] <Bomber4Chats> http://pastebin.com/0Msx9X0T
[07:16:52] <eszett> One of my problems soldering a TQFP is, how do i fix the Atmega before i fix a pin of it? When i align it by hand and touch the Atmega with the iron's tip to fix a pin, then its getting misaligned again.
[07:18:31] <Bomber4Chats> So just to reiterate - how does one connect to a usb-connected device which has an ATXMega128u4?
[07:18:34] <Bomber4Chats> in Linux?
[07:18:44] <Bomber4Chats> (connect to read the serial channel)
[07:25:32] <Thrashbarg> eszett: maybe try tinning a pad with a little solder, then solder the pin to that while holding the IC still with a pair of tweezers or something.
[07:26:08] <Thrashbarg> are you using thin solder and a decent tip?
[07:27:46] <Bomber4Chats> The device itself is detected as a HID-Class device
[07:28:26] <_ami_> Bomber4Chats: i think it has already have HID-class firmware.
[07:28:46] <Bomber4Chats> OK...
[07:28:54] <Bomber4Chats> so, how do I read serial data from a HID-class device?
[07:29:26] <_ami_> I never worked on Atmel usb mcu though. worked on vusb though.
[07:38:34] <eszett> Trashbag: yea, but holding the IC still is the problem, i cant hold it still.
[07:39:05] <eszett> Some guy recommended to fix the IC with tape before fixing a pin of it. I try that
[07:39:18] <twnqx> actually
[07:39:19] <eszett> Trashbag: 3mm chisel tip and 0.5mm solder wire
[07:39:36] <twnqx> the trick is normally, you just put enough tin on one pad, then move the ic into the liquid solder
[07:39:57] <twnqx> then it is kind of fixed, and you go for a pin on the opposite side
[07:40:07] <twnqx> side/corner, you know what i mean i hope
[07:40:46] <eszett> twnqx: yes but before fixing a pin, the other pins have to be perfectly aligned to the pads. And MCU is whiggling and shifting all the time i touch it, so there is no perfect alignment anymore
[07:41:01] <twnqx> nah
[07:41:33] <twnqx> solder down one pin, shift it so the second is done, re-solder the first to relieve the mechanical stress, after that it should be good enough
[07:42:21] <eszett> ah, you mean the first fixed pin can become torqued abit, i understand
[07:42:28] <twnqx> yes
[07:43:07] <eszett> ok ill try that
[07:43:17] <twnqx> just down go for 45° or so :P
[07:43:19] <Bomber4Chats> I'm a bit confused here..: https://www.obdev.at/products/vusb/links.html
[07:43:25] <twnqx> soldering to a lost pin is annoying
[07:44:25] <eszett> twnqx: either that, or taping the IC down with kapton tape. Ill try both methods
[07:45:32] <Bomber4Chats> so I have a feeling my HID device is here: /sys/class/hidraw/hidraw2/device/
[07:45:49] <Bomber4Chats> basead on: [ 1168.045175] hid-generic 0003:03EB:2402.0007: hiddev0,hidraw2: USB HID v1.11 Device [######### GmbH TPatch 0.1] on usb-0000:00:14.0-1/input0
[07:46:13] <Bomber4Chats> so how to I read the serial data on that device?
[07:46:24] <twnqx> lsusb -vv
[07:58:22] <Bomber4Chats> twnqx: sorry, I meant the serial data, like a serial monitor, like for arduino
[07:58:28] <Bomber4Chats> (But for an atmel device)
[07:58:38] <Bomber4Chats> lsusb -v only gives me the description of the device
[07:58:44] <Bomber4Chats> I'd like to read the data that it sends
[07:59:09] <twnqx> oh, i misread that as serialnumber
[07:59:44] <twnqx> if you have an evdev interface for it, that would probably be the easiest way
[08:03:13] <twnqx> https://paste.pound-python.org/show/yEVjjndHL3QXVoiTY68x/ this is something i wrote in 2006, 2008 or 2011, according to the file timestamps in the dir :P
[08:06:07] <twnqx> heh, cool, it still works.
[08:06:14] <twnqx> >sudo ./evr /dev/input/event7
[08:06:14] <twnqx> Event Interface version 1.0.1
[08:06:14] <twnqx> Running on HDA Intel PCH Front Mic
[08:06:14] <twnqx> Connected at ALSA
[08:06:14] <twnqx> Connected to unknown
[08:06:15] <twnqx> Switch event: Unknown switch 4, state 0
[08:06:17] <twnqx> Switch event: Unknown switch 4, state 1
[08:06:50] <twnqx> guess i should update some constants.
[08:07:35] <Bomber4Chats> is there any other command, script, library I can use to read a /dev?
[08:07:46] <Bomber4Chats> what's evdev?
[08:07:49] <twnqx> there's not "a /dev"
[08:08:00] <twnqx> evdev is the linux kernel's event interface
[08:08:40] <Bomber4Chats> How do I use evdev?
[08:08:52] <twnqx> basically, every key press, key release, mouse move, other HID (human interface device) event, power button, speaker/microphone jack plug/unplug, laptop's lid open/close, power state change, etc will cause an event
[08:09:37] <twnqx> which can be read from the appropiate input device (every physical switch, device, ... will get its own input interface)
[08:10:03] <twnqx> and i didn't know any ant that time, which is why i just wrote my own
[08:10:11] <twnqx> s/ant/at/
[08:10:31] <_ami_> there is one program called evtest
[08:10:43] <_ami_> you can use that to listen events
[08:10:59] <Bomber4Chats> ami: can I read serial data from it?
[08:11:16] <twnqx> a hid device is a hid device, not a serial port
[08:11:19] <_ami_> it shows the data - at least for HID keyb
[08:11:46] <_ami_> Bomber4Chats: yah, your terminology for data is bit confusing for us. :P
[08:11:55] <Bomber4Chats> OK, but I have this hid device that is able to communicate data through telnet to my computer (on windows, with the firmware properly uploaded)
[08:12:30] <twnqx> through..... telnet?
[08:12:36] <Bomber4Chats> yes
[08:12:39] <Bomber4Chats> 100%
[08:12:44] <twnqx> yeah i don't think i can help you, i can't nearly follow you
[08:13:02] <Bomber4Chats> what's hard to believe that a device can communicate through telnet?
[08:13:03] <twnqx> telnet is a network protocol, running on top of tcp on top of ip on top of whatever
[08:13:29] <twnqx> you connect to a tcp socket with it
[08:13:56] <twnqx> i have not the slightest idea hw that release to a universal serial bus human interface device
[08:14:04] <twnqx> how that relates*
[08:14:10] <_ami_> :)
[08:15:50] <twnqx> (ok, you could obviously implement a daemon that on the one side listens to that specific usb hid, and on the other side relays the received data via a trivial socket interface that would be reachable by telnet)
[12:17:59] <Skippy_42> Hey guys
[12:18:10] <bss36504> Howdy
[12:20:40] <Skippy_42> I have a #define foo 1 in my code, sureley early enough, and later the compiler, on the part with #ifdef foo class bar { ... } #endif, does not see the foo and so does not compile, even if Atmel Studio 7 does highlight the foo as 1 (not grey)
[12:21:13] <bss36504> In the same compilation unit?
[12:21:13] <Skippy_42> My boss said something about configuring atmel studio with global variables in the project settings or something like that, but I cannot remember
[12:21:17] <Skippy_42> ye
[12:21:40] <Skippy_42> if I write the #define foo in the file where the compiler does not see it, it works
[12:21:46] <bss36504> Well, you shouldnt need to even have a value after foo in the define line....
[12:21:51] <Skippy_42> but if I include a .h file, it doesnt
[12:21:53] <bss36504> but I dont know why it wouldnt work later
[12:22:05] <bss36504> What about a .h?
[12:22:17] <Skippy_42> I write an abstract example, sec
[12:22:27] <bss36504> Ok
[12:23:02] <Tom_itx> your defines should probably be at the highest level ahead of anything else
[12:24:02] <Skippy_42> http://pastebin.com/KDXBTr9B
[12:24:28] <Skippy_42> so here, in bar.h, the compiler thinks foo is null, even if atmel studio does not highlight it like this
[12:24:34] <Skippy_42> if I put #define foo 1 in the bar.h, it works
[12:25:45] <bss36504> I wonder if the preprocessor does macro substitutions first, and then includes second. Thats the only explanation I can think of
[12:26:05] <cehteh> no
[12:26:26] <cehteh> you prolly do some other error
[12:26:37] <cehteh> also you may want include guards
[12:26:54] <cehteh> and you can add diagnostics in a #else branch
[12:27:25] <cehteh> maybe the foo.h isnt the foo.h you meant .. from other path?
[12:28:06] <cehteh> did you try your cooked example *as is* ?
[12:28:18] <cehteh> i'll bet that would work
[12:28:40] <Skippy_42> the actual code is way bigger and I am not allowed to post it completley. There are some thousand lines of code
[12:28:40] <cehteh> (and give a syntax error :D)
[12:28:55] <Skippy_42> I try to make a closer example
[12:28:55] <cehteh> well the error lies somewhere there :D
[12:29:17] <cehteh> does foo.h include anything?
[12:34:08] <Skippy_42> http://pastebin.com/BGDcszn9
[12:35:27] <Skippy_42> oh damn I forgott the include. Of course there is #include AccessManager.h in the AccessManager.cpp file
[12:35:33] <cehteh> .ino barf :D
[12:35:53] <Skippy_42> ye, it's arduino stuff ^^
[12:36:36] <cehteh> why main() then? :D
[12:36:47] <Skippy_42> I hurried :P
[12:37:10] <Skippy_42> just imagine there is a loop() and start() ^^
[12:37:25] <Skippy_42> setup*
[12:37:55] <Skippy_42> so as I understood from my boss, he put the YKBoard and YKNet defines somehow through the settings into the precompile / compile (?) process I guess
[12:38:22] <cehteh> i dont know atmel studio
[12:38:46] <bss36504> Just poke around the settings, it's in there
[12:39:01] <Skippy_42> any idea what to google?
[12:40:45] <bss36504> I don't know off the top of my head. If I was at home I'd be able to just find it in the settings. Alternatively look up how to pass macros to GCC and modify the command line directly through atmel studio
[12:41:07] <Skippy_42> ok thx, I check it
[13:23:38] <Skippy_42> yay, I got it. I had to add the symbols in the Toolchain Tab for the C and C++ Compiler as defined Symbols
[13:23:45] <Skippy_42> thx for helping
[17:39:44] <green_snow> when I place a variable or an array into PROGMEM, is it accessible only from the main() function?
[17:41:26] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/abcminiuser/articles/progmem_basics_index.php
[17:41:31] <Tom_itx> green_snow, a good read for you
[17:43:43] <green_snow> oh... now I understand why my code didn't work
[17:43:50] <green_snow> thanks Tom_itx :)
[17:57:10] <Lambda_Aurigae> it does exactly what you tell it to do.
[17:57:17] <Lambda_Aurigae> not necessarily what you WANT it to do though.
[18:29:05] <Tom_itx> ESP programming
[18:30:12] <Casper> and sometime what you tell it to do is really not what you tought you told it to do
[18:30:21] <Casper> ... sometime it's painfull..
[18:39:31] <kre10s__> Sometimes you're not even sure you know what it is that you want to do.
[18:40:25] <Lambda_Aurigae> if programming is painful, you shouldn't be reprogramming your tensor device while it is connected to your body.
[18:55:01] <Chillum> "You'll never find a programming language that frees you from the burden of clarifying your ideas." - The Uncomfortable Truths Well