#avr | Logs for 2014-06-04

Back
[05:37:36] <malinus> do you guys usually use the C11 or C99?
[05:39:34] <ivanshmakov> malinus: My development environment (GCC 4.8.2-based) supports C11, so I see no reason to stick with the earlier versions.
[05:52:03] <antto> my avrgcc is 4.3.3 :/
[05:55:06] <malinus> antto, are you on debian stable or what :D
[05:55:24] <antto> winXP
[05:55:32] * malinus chuckles
[05:55:59] <malinus> haha, well the writer of game of thrones is still using dos :)
[05:56:15] <Lambda_Aurigae> 4.7.2 here.
[05:56:20] <antto> it doesn't really bother me, the stuff i code works..
[05:57:01] <antto> untill i f*ck it up of course ;]
[05:57:10] <malinus> 4.9.0 here #newestversion #upToDate #avrBoss
[05:57:20] <antto> heh
[05:57:21] <malinus> feels good to be on arch :D
[05:57:28] <antto> oh noes
[05:58:12] <antto> i knew a guy who was obsessed with this "arch" linux thing
[05:58:20] <antto> ...he vanished into the void
[05:58:28] <antto> :~(
[05:59:01] <malinus> RIP
[05:59:19] <antto> nah, he can't be dead
[05:59:33] <Lambda_Aurigae> just recompiling
[05:59:37] <malinus> haha
[05:59:38] <antto> hueahueahueahuea
[06:00:03] <antto> i hate updating stuff too often
[06:00:10] <ivanshmakov> Debian to GNU/Linux is what Wikipedia is to encyclopedias.
[06:00:12] <antto> once a month is too often
[06:00:32] <ivanshmakov> antto: Several of my hosts are exposed to the Internet, so I’d rather apply security updated regularly.
[06:00:48] <antto> sure then..
[06:00:56] <ivanshmakov> antto: Once I’ve delayed it for a few days, and got a rootkit as the result.
[06:01:20] <antto> on linux?
[06:01:28] <ivanshmakov> antto: Yes.
[06:01:34] <malinus> ivanshmakov, which exploit was that? And which linux distro/version
[06:01:35] <antto> o_O
[06:01:44] <malinus> GNU+linux ;)
[06:01:55] <malinus> as I prefer to call it
[06:02:04] <ivanshmakov> antto: Debian stable does it the proper way: they issue updates /if and only if/ there’s a security issue.
[06:02:34] <malinus> because who needs new functionality, it worked fine 5 years ago - it will work now :)
[06:02:36] <ivanshmakov> malinus: That was the one against the Exim MTA; Debian GNU/Linux 6. (Or was it 5?)
[06:02:54] <ivanshmakov> malinus: Debian release cycle is something like 2 years, not 5.
[06:03:15] <ivanshmakov> malinus: And when I need functionality, — I have a Debian testing in a chroot.
[06:03:53] <malinus> ivanshmakov, I was saying it mostly in a joking manner, hence the :). And yeah, debian is great. I just like things breaking from time to time, for me to fix :)
[06:04:19] <malinus> like the mechanic driving a old car :D
[06:04:50] <antto> i don't like things to break
[06:06:05] <antto> or if they do - only in a controlled manner ;P~
[06:44:34] <twnqx> ivanshmakov: debian feels like it's always a decade behind, at least
[06:45:06] <Lambda_Aurigae> I like to piss off the debian purists by using ubuntu
[06:45:41] <twnqx> i like to piss of debian people by only supporting latest release versions of software in my programs
[06:45:57] <twnqx> "what, kernel < 3.14.5? well, update."
[06:46:39] <twnqx> (i use gentoo testing myself, because gentoo stable is far too often too outdated, featurewise)
[06:46:53] <Lambda_Aurigae> I've tried gentoo but it was too much work.
[06:47:14] <Lambda_Aurigae> and redhat derivatives, specially fedora, just bug me for some reason.
[06:48:37] <twnqx> debian/redhat/suse derivatives bug me for all the same reason - they make software development unneccessarily difficult by refusing to install headers etc by default
[06:59:30] <Lambda_Aurigae> it's been a while since I played with other distros.
[06:59:49] <Lambda_Aurigae> gonna grab arch and gentoo and see what they have to offer.
[07:16:24] <RattusRattus> twnqx: I doubt that only supporting the latest version pisses off just debian users. it is the debian package maintainers responsibility to track upstream and include it into the distro. of cause at some point you do need to freeze a distro (it gets to be a real clusterf**k if libs keep changing) and debian has to do this accross more than one arch so it is a bigger task.,..
[07:16:52] <twnqx> i disagree with fixing versions, period
[07:16:54] <RattusRattus> but anyone wanting to be at the tip can just use sid
[07:17:00] <twnqx> my main and foremost reason to run gentoo
[07:17:24] <twnqx> instead of fucking up backports of bugfixes to obsolete software versions and wasting developer resources they just upgrade
[07:17:35] <RattusRattus> twnqx: that is fine for a single user, it is a real problem for the guys running networks of many boxes
[07:18:05] <twnqx> i currently run 8 instances of gentoo
[07:18:15] <twnqx> i know people running thousands of them with puppet
[07:19:17] <twnqx> and i remember the grand day when i had to throw a fully working application because even 5 years after introduction, debian didn't have NPTL to signals just arrived at random threads
[07:19:28] <RattusRattus> yep. and they tend to run a stable distro for a long time (until all the packages that they have on most of the devices under their control
[07:19:35] <twnqx> yes
[07:19:41] <RattusRattus> can be upgraded to a newer version)
[07:19:47] <twnqx> breaking fucking everything that's relying on years-old standards
[07:19:51] <RattusRattus> it is horses for courses
[07:20:44] <RattusRattus> twnqx: so you are arguing for both long term stability and tip installations on the same box at the same time????
[07:20:52] <twnqx> my installations
[07:20:56] <twnqx> are up to 8 years old
[07:20:58] <twnqx> rolling
[07:21:06] <twnqx> that's what i call long-term stable
[07:21:32] <twnqx> not 8-years-long-the-same-obsolete-software-without-all-the-features-you-want-and-need
[07:21:58] <RattusRattus> sounds like it, but how then can you say i like to piss of debian people by only supporting latest release versions of software in my
[07:22:02] <RattusRattus> programs
[07:22:08] <twnqx> i don't "like" to do it
[07:22:16] <RattusRattus> :-)
[07:22:18] <twnqx> it just happens because of their wrong approach.
[07:22:40] * RattusRattus thinks patching security vulns is a good idea
[07:23:11] * twnqx thinks patching them to upgrade to the fixed version upstream provides is a better idea
[07:23:21] <twnqx> if a resonable feature is available only in git-head of a certain library, that version becomes requirement for me
[07:23:53] <RattusRattus> agrees *but only* if that doesn't introduce dependancy issues for other packages on the same system
[07:23:59] <sdes_> 1
[07:24:09] <twnqx> then effing upgrade those
[07:24:20] <twnqx> i treid debian over and over
[07:24:28] <RattusRattus> which you may not be able to upgrade because you are already at the tip for that package
[07:24:39] <twnqx> and always, every single time, ran against "sorry, that feature is only available in a version that nly exists in sid"
[07:24:42] <twnqx> every. signle. time.
[07:25:13] <RattusRattus> then run sid and accept the unstability (or compromise on testing)
[07:25:22] <twnqx> if i run sid
[07:25:42] <twnqx> i can just run gentoo and drop dependencies i don't want, and have full insalls of packages (including -dev) as default
[07:26:20] <RattusRattus> ack - sounds like you have found the perfect distro for your use case
[07:26:20] <twnqx> and so that's what i chose.
[07:26:45] <twnqx> e.g. i was laughing at proftpd security holes in debian
[07:26:54] * RattusRattus was trying to point out that one size does not fit all and that there are reasons for this
[07:26:54] <twnqx> which only existed with the proftp-mysql auth
[07:27:28] <twnqx> because i wouldn't even considering building proftpd with mysql, but debian has to cater to everyone...
[07:27:38] <twnqx> even the 0.001% of users who want that feature
[08:59:00] <ivanshmakov> twnqx: Especially in the world of “desktop” software, every bug fixed by a new version costs at least two brand new ones introduced by the same new version.
[08:59:39] <Jartza> hmmh
[09:00:23] <twnqx> and every "bugfix backport" that is not done by the original maintainers has a good chance of being misimplemented (see: 16 bits of entropy in openssl generated certificates, only in debian-based distroes thanks to backporint bugfixes instead of updating)
[09:00:32] <Jartza> I looked around Internet for a nice & clean & easy solution to transfer data to attiny85 from headphone-jack, didn't find any clean&easy :)
[09:01:05] <ivanshmakov> twnqx: That bugs is, like, years away by now.
[09:01:08] <Jartza> then tried looking Wikipedia for different modem-encodings. all of them were full of mathematical formulas, which caused headache.
[09:01:15] <Jartza> so I decided to implement my own
[09:01:43] <twnqx> doesn't mean shit as it has been there because they refused to update an API identical software.
[09:02:20] <twnqx> or the fact that i TODAY can't have up-to-date TLS version (1.2/1.3) on debian stable but have to make do with deprecated because insecure because of... old software versions
[09:02:23] <Jartza> now I have modem code which adapts automatically to 500-2000 baud "signalling rate", although the actual bitrate depends of the data.
[09:02:36] <ivanshmakov> twnqx: /ABI/ takes over /API/ when it comes to “binary” distributions.
[09:02:43] <twnqx> so what
[09:02:49] <twnqx> recompile the distro, update evrything
[09:03:01] * twnqx doesn't see a problem - at all
[09:03:04] <Jartza> but averages to 832bps :)
[09:04:08] <Jartza> and attiny85 is running on internal 8MHz osc.
[09:07:09] <Jartza> I mean, the bitrate averages to 832bps running on 2000baud signalling rate
[09:31:30] <ivanshmakov> twnqx: By a chance, are you paid for watching over the 8 hosts you’ve mentioned above?
[09:32:29] <twnqx> no, only taking a look at a dozen others. most of the company servers (not maintained by be) run on gentoo by company choice.
[09:32:52] <twnqx> debian is just too outfated for everyone in the company.
[09:32:56] <twnqx> outdated*
[09:33:49] <ivanshmakov> twnqx: Would you consider watching over a couple of hosts of mine in addition? Naturally, that’d be on an unpaid basis, – I’m a bit stretched when it comes to my hobbies already.
[09:34:28] <twnqx> no, i don't take responsibilities like these at all.
[09:34:42] <ivanshmakov> twnqx: And the Debian Security Team does.
[09:34:45] <twnqx> i don't fix friend's PCs either, neither hardware nor software
[09:35:09] <twnqx> so does the gentoo security team
[09:35:13] <twnqx> what are you trying to tell me?
[09:36:26] <twnqx> that typing emerge --sync; emerge -auvDNt world is so much more work than typing apt-get update?
[09:36:30] <ivanshmakov> twnqx: Do they test their fixes against all the build flags combinations whatsoever?
[09:36:51] <twnqx> "their fixes" is updating
[09:37:28] <ivanshmakov> twnqx: And if the upstream delays the fix?
[09:38:10] <twnqx> if needed a git snapshot
[09:39:01] <twnqx> just stop argueing. i disagree with just about everything that binary distros do, from forcing wrong oppinions about the features you want to have to the upgrade policies
[09:39:41] <twnqx> from the splitting off of devel packages to fingering other people's code
[09:40:42] <ivanshmakov> twnqx: My argument is that whatever there /is/ an employer, – it’s up to them to pay for the solution their heads decide to be the best. For us, the hobbists, – Debian is more or less the only choice.
[09:40:51] <twnqx> what
[09:42:00] <twnqx> ok, either you stop this nonsense bullshit, or i will have to put you on ignore. most people i know actually use gentoo privately and for their hobbies, and most complain about how crap the debian/ubuntu/centos/sles whatever they are forcefed at work is.
[09:42:20] <twnqx> you can think and choose whatever you want, but please don't think that you are the only one that can be right
[09:43:54] <ivanshmakov> twnqx: Then just please do so. I’m not in the mood of listening to the perceived “deficiences”, whether Debian or “binary distros” as a whole, either.
[09:46:23] <ivanshmakov> (And I still wonder why FTP was ever mentioned in this conversation? By itself, FTP predates not only Debian, but even the GNU project! The technology of 1970s, the true ancient artifact of the Internet.)
[09:48:59] <twnqx> because, as an extreme example, proftpd (a specific FTP server implemenation with a huge amount of historically known security vulnerabilities) is a prime example of "deficiences" of binary distributions thanks to its sheer amount of optional dependencies. I can't see FTP as a protocol mentioned. Sorry to have made you read something you didn't want to read based on your request.
[09:49:46] <ivanshmakov> twnqx: No need to apologize, – I’ve just skipped over this comment above.
[09:56:03] <jacekowski> gentoo would be great if not the fact that even on modern cpu's compilation takes ages
[09:57:10] <jacekowski> on servers it may be ok because you rarely need something new installed
[09:57:18] <jacekowski> and updates are planned anyways
[09:58:16] <ivanshmakov> jacekowski: How could updates be “planned” on servers, when security issues are not?
[09:59:15] <ivanshmakov> jacekowski: As I’ve mentioned above, an upgrade delayed for a couple of days have resulted in getting a rootkit for me personally.
[10:03:16] <ivanshmakov> (Also to note is that having several servers running the very same builds of certain software helps save on backup storage costs, though I have to admit that my own “non-solution” to the backup problem is more an ad-hoc hacking kludge. Yet, it /does/ hardlink the identical files, which is a considerable win, diskspace-wise.)
[10:13:51] * twnqx is happy with compiling once and rolling out the resulting binaries to identical servers
[10:14:28] <twnqx> also, hardlinking works only for virtual machine, or do you refer to backup?
[10:14:44] * twnqx uses rsync with hardlinking for unchanged files to get incremental backups
[10:27:22] <ivanshmakov> twnqx: The backup, obviously; as all the (“system” parts of the) backups end up on the same filesystem. Rsync here, too.
[10:27:47] <ivanshmakov> twnqx: Compiling once? A binary distribution, at last!
[10:27:51] <twnqx> heh
[10:28:33] <twnqx> i am still tempted to just rely on zfs' deduplication feature to take care of it
[10:41:07] * aandrew uses duplicity which is basically librsync + gnupg + your choice of transfer protocol (ssh/rsync/filesystem/s3/gdrive/etc.)
[13:26:44] <Yolarina> On an Atmega328p, can I use two comparators on timer 1 in CTC mode? Both COMPA and COMPB interrupts seem to be triggered when TCNT1 reaches OCR1A (although I'd like to be able to use OCR1B too).
[13:32:10] <Kev> code ?
[15:54:50] <Jartza> maybe it was an advantage that I didn't understand half of the wikipedia-articles about modem encodings.
[15:54:53] <Jartza> so I implemented my own
[15:55:26] <Jartza> less than 50 lines of C, average bps seems to be now around 2800bps
[15:55:41] <Jartza> from android phone to attiny85 via headphone-cable
[15:55:55] <Jartza> :)
[16:00:32] <ivanshmakov> Jartza: Is it bidirectional?
[16:03:43] <Jartza> ivanshmakov: not yet
[16:04:03] <ivanshmakov> Jartza: That’s sad.
[16:04:20] <ivanshmakov> Jartza: Did you, by a chance, discover something like modified frequency modulation?
[16:05:33] <Jartza> I have no clue :)
[16:07:50] <Jartza> I even don't know how to call it
[16:08:18] <Jartza> and it's still under development, I started with it yesterday
[16:09:31] <Jartza> I'm so retro, so I'm sorta doing the same thing as c64 datasette did
[16:09:47] <Jartza> encoding zeroes and ones with different length
[16:09:49] <ivanshmakov> Jartza: Be sure to compare the code to https://en.wikipedia.org/wiki/Modified_Frequency_Modulation, and the articles linked from there.
[16:10:57] <Jartza> sure, I've read quite a lot of wiki pages :)
[16:33:27] <Kev> Jartza, you want to build your own modem ?
[16:54:42] <malinus> I thought I could fine some nice avr-code for debuncing, apperently everyone seems to just "if(down) _delay_ms(25) if(down) its_down"
[16:54:50] <malinus> *find
[16:54:57] <malinus> wtf
[17:00:43] <Kev> what did you expect
[17:00:50] <aandrew> I have some pretty awesome debounce routines for ancient pic
[17:01:00] <aandrew> debounced 8 inputs simultaneously in a tiny amount of code/ram
[17:03:30] <malinus> Kev, something sane
[17:05:39] <aandrew> there's nothing insane about sample/wait/sample and hit if samples are equal
[17:05:55] <aandrew> it of course depends on exactly what you're trying to debounce and what the noise sources are
[17:06:01] <aandrew> but for buttons that is perfectly legitimate
[17:10:06] <malinus> aandrew, maybe if your mcu isn't doing anything else. If you are debouncing *one* button, and that is the sole functionality of your mcu :D
[17:10:52] <aandrew> so you put it in a timer loop
[17:11:36] <malinus> aandrew, yeah that's what I'm doing. I'm just suprised that so many go with what seems as a terrible approach.
[17:11:40] <aandrew> every 25ms you grab the pin state and if it's not handled, see if it matches last state and show it's hit if not
[17:11:56] <aandrew> let me pastebin something I do. it's a bit overkill but it works well and is extensible
[17:13:39] <malinus> aandrew, hmm, my approach is to simply make the interrupt caused by the pin solve it, by comparing the last state of the button, and storing when the change happend.
[17:15:17] <aandrew> malinus: http://pastebin.com/v1jNwLQF
[17:15:45] <aandrew> I have a timer interrupt that peels off 1ms, 10ms, 100ms and 1000ms and provides a flag for each
[17:16:18] <aandrew> my main loop is just a while (1) { if (ten_ms_flag) { ten_ms_flag = FALSE; } if (hundred_ms_flag() { hundred_ms_flag = FALSE; } };
[17:16:37] <aandrew> and for keys, for example, I use the hundred_ms loop to debounce it
[17:17:08] <aandrew> then it's just calling if (key_changed(KEY_FOO)) { if key_state(KEY_FOO) { ... }; key_handled(KEY_FOO); }
[17:17:22] <aandrew> so I can detect both key press and release, and it's easy to set up key repeating and so on
[17:17:35] <malinus> that's some pretty sexy C code. Mine is alway a mess, because if I can't make classes I just make pasta.
[17:18:19] <aandrew> it'd be pretty easy to optimize that down to something tiny, but there are probably other areas where expending the effort would be worthwhile
[17:18:23] <aandrew> remember the first two rules of optimization
[17:19:35] <aandrew> hell you could even modify that to take different amounts of time to debounce different inputs
[17:20:06] <aandrew> one application I have has the concept of "fast" inputs (prox senors) -- they're debounced in a 10ms loop rather than 100ms loop, and with a different debounce_cnt
[17:21:27] <malinus> I think most buttons are closer to 20ms then the 10ms
[17:24:00] <aandrew> malinus: I assume you've read http://www.ganssle.com/debouncing.htm and http://www.embedded.com/electronics-blogs/break-points/4024981/My-favorite-software-debouncers and http://hackaday.com/2010/11/09/debounce-code-one-post-to-rule-them-all/
[17:24:09] <aandrew> there's a REALLY great paper on debouncing but I can't find it right now
[17:24:27] <malinus> oh not the last one
[17:29:49] <malinus> thanks a bunch
[17:29:50] <aandrew> hey there is my old PIC debounce code (well not mine, I based mine off of this concept of vertical counters: http://www.dattalo.com/technical/software/pic/debounce.html
[17:29:55] <aandrew> that's a LOT older than 2006 though, I think I implemented mine around 2000/2001 or a little earlier