Re: Arduino UNO - upload not working

2011-07-31 Thread Wayne Sierke
On Sun, 2011-07-31 at 00:20 +0100, Michael wrote:
 On 30/07/2011 07:56, Wayne Sierke wrote:
 
0) The automatic reset for programming generally didn't work for me.
  However after judicious experimentation I was able to time a manual
  reset of the board being programmed by waiting for the Binary sketch
  size: message to appear in the Arduino IDE and timing a reset from that
  (about 2-3 seconds in my case).
 
 
 It works, I mean the workaround, it works! Thank you so much. In my case 
 it's a bit less than one second. I still need to test it with more 
 sketches but for now it looks good and gives me hope :)

That's good news. :)

 Could you also tell me what versions of arduino (IDE), uarduno and 
 avrdude you are using? Is it vanilla ports or did you have to apply any 
 extra patches?

All vanilla.

arduino-0022_1
uarduno-1.0
avrdude-5.10

openjdk6-b22_6
rxtx-openjdk6-2.1.7r2_7


Wayne


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't build teTeX port in FreeBSD 8.2 amd64

2011-07-31 Thread Anton Shterenlikht
On Sat, Jul 30, 2011 at 08:00:25PM -0500, Antonio Olivares wrote:
 
 I have been using TeX for a while and I have never had to set up
 anthing like this :(  I had used MikTeX in winblow$ and TeTeX in linux
 distros and FreeBSD 5.3/FreeBSD6.2, and I had never had to mess with
 TDS.

I know, this is just a fix.
We are fortunate enough to
have the ports tree. That
is the way forward. But
some work is required for
this to happen.

 
 This is what I always did, I tried to compile a tex project and it
 failed, I looked at which *.sty file was needed and I downloaded it
 from CTTAN or off another computer that had it and put it directly on
 the folder that I was working on.  This had always worked for me.

Apart from *sty files, there
are also fonts, and those
should live in correct directories
to be found.


-- 
Anton Shterenlikht
Room 2.6, Queen's Building
Mech Eng Dept
Bristol University
University Walk, Bristol BS8 1TR, UK
Tel: +44 (0)117 331 5944
Fax: +44 (0)117 929 4423
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


invalid argument in select() when peer socket is in FD_SET

2011-07-31 Thread Christoph P.U. Kukulies
I have written a  small to test TCP/IP roundtrip times of the packets in 
a proprietary protocol and while
compiling and running this server on different platforms (Windows 
7/cygwin, UbuntuLinux, FreeBSD 8.0 Release), I found
that the server produces an error when the listening socket (on which 
the accpet() is performed) is member of the select()

fd_set.

On the other platforms the program works without error, just under 
FreeBSD I'm getting this invalid argument error.


Comments appreciated (despite comments about the error checking logic :)

Here is the code:
// testsrv.c
//  gcc -o testsrv testsrv.c
//

#include stdio.h
#include unistd.h
#include sys/types.h
#include sys/socket.h
#include netinet/in.h
#include arpa/inet.h
#include netdb.h
#include string.h

#include sys/select.h

#define USEDBUFSIZ 60
#define MAX_HOSTNAME 256
#define MAXFDS 256
#define CLRBUF  memset(buf,0,sizeof(buf))
#define max(a,b)(((a)  (b)) ? (a) : (b))
static unsigned char buf[256];
int array_of_fds[MAXFDS];
static fd_set   clientfds;
#define SOCKET int
void   *memset(void *, int, size_t);
int enter  (int);
int remov  (int);
int invalidip  (char *);
voidexit  (int);
int getv   (int, unsigned char *, int);
int getfds ();

int
main(int argc, char **argv)
{
int nfds;
static fd_set   readfds;
SOCKET  ListenSocket, newsockfd;
struct sockaddr_in cli_addr;
struct sockaddr_in service;
struct hostent *thisHost;
int bOptVal = 0;
int bOptLen = sizeof(int);
charhostname[256];
char   *host_addr;
struct in_addr  addr = {0};
char   *ip;
u_short port;
int iResult = 0;
int i , n, m, clilen, dummy, connect = 0;
struct timeval  tv;
//---
//Create a listening socket
ListenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (ListenSocket == -1) {
perror(socket creation);
return 1;
} else
printf(ListenSocket=%d\n, ListenSocket);
//---
//Bind the socket to the local IP address
// and port 3210
port = 3210;
if (gethostname(hostname, 256))
perror(gethostname failed\n), exit(3);
printf(%s\n, hostname), fflush(stdout);
thisHost = gethostbyname(hostname);
ip = inet_ntoa(*(struct in_addr *)(*thisHost-h_addr_list));


if (argc == 2) {
host_addr = argv[1];
service.sin_addr.s_addr = inet_addr(host_addr);
thisHost = gethostbyaddr((const char *)service.sin_addr.s_addr,
 sizeof(service.sin_addr.s_addr), AF_INET);
if (thisHost == 0)
printf(host unknown\n), exit(3);
if (invalidip(host_addr))
printf(invalid IP\n), exit(4);
} else {
service.sin_addr.s_addr = inet_addr(ip);
}
service.sin_port = htons(port);
service.sin_family = AF_INET;

iResult = bind(ListenSocket, (struct sockaddr *)service, 
sizeof(service));

if (iResult == -1) {
perror(bind);
shutdown(ListenSocket, SHUT_RDWR);
return 1;
}
listen(ListenSocket, SOMAXCONN);
printf(SOMAXCONN=%d %d\n, SOMAXCONN, FD_SETSIZE);
/* all sockets are put into an own array_of_fs */
/* in the while() loop below the FD_SET id used by looping through 
the */

/* array_of_fds to fill the readfds array in the select() */

enter(ListenSocket);

/*
 * Wait for connect
 */
tv.tv_sec = 0;
tv.tv_usec = 500;   /* 5 seconds */

printf(Server %s listening on port %d\n, thisHost-h_name, port);
memset((void *)array_of_fds, 0, (size_t) MAXFDS * 
sizeof(*array_of_fds));

nfds = ListenSocket + 1;
while (1) {
FD_ZERO(readfds);
FD_SET(ListenSocket, readfds);
for (i = 0; i  MAXFDS; i++) {
if (array_of_fds[i]) {
nfds = max(nfds, array_of_fds[i]) + 1;
FD_SET(array_of_fds[i], readfds);
}
}
n = select(nfds, readfds,
   (fd_set *) NULL, /* not interested in write */
   (fd_set *) NULL, /* ...or exceptions */
tv);/* timeout */

switch (n) {

case 1:
clilen = sizeof(cli_addr);
/* first test if a new client has connected */
if (FD_ISSET(ListenSocket, readfds)) {
newsockfd = accept(ListenSocket,
(struct sockaddr *)cli_addr, clilen);
if (enter(newsockfd)) /* socket of new connection is 
entered*/

printf(\n%d.connect! , ++connect), fflush(stdout);
else
printf(too many connections), exit(1);
sprintf(buf, ENTERED %d of %d, 1, 10);

Re: easy Firewall setup

2011-07-31 Thread Antonio Olivares
 A Is there an easy firewall setup available somewhere (like the one
 A referenced below but for FreeBSD)?

   Here's a script you can use to generate a rules file for IPF.

 --

Karl,

I have used your script and it generated me a nice ipf.rules file

/* ipf.rules /
quadcore# cat /etc/ipf.rules
# Generated by make-ipf-rules v1.10 at Sun Jul 31 10:42:21 CDT 2011
#
# NAME:
#/etc/ipf.rules
#
# DESCRIPTION:
#Ruleset for IPF packet filter.
#
# AUTHOR:
#Antonio Olivares olivares14...@gmail.com

# 
# We don't care about NETBIOS broadcast crap, bootpc requests, or IGMP.
block in quick on msk0 proto udp  from any to any port = 68
block in quick on msk0 proto udp  from any to any port = 137
block in quick on msk0 proto udp  from any to any port = 138
block in quick on msk0 proto igmp from any to any

# 
# Now block everything coming down the network.
block in  log  on msk0 all
block out log  on msk0 all

# 
# Get rid of anything with options, as these can be used to hack.
block in  log quick from any to any with ipopts

# 
# Get rid of short TCP/IP fragments (too small for valid comparison)
# as these can be used to hack.
block in  log quick proto tcp from any to any with short

# 
# Allow all traffic on loopback.
pass  in  quick on lo0 all
pass  out quick on lo0 all

# 
# Block all the private routable addresses, as these should never
# come down the network, nor should we be talking to them.
block out quick on msk0 from any   to 192.168.0.0/16
block out quick on msk0 from any   to 172.16.0.0/12
block out quick on msk0 from any   to 127.0.0.0/8
block out quick on msk0 from any   to 10.0.0.0/8
block out quick on msk0 from any   to 0.0.0.0/8
block out quick on msk0 from any   to 169.254.0.0/16
block out quick on msk0 from any   to 192.0.2.0/24
block out quick on msk0 from any   to 204.152.64.0/23
block out quick on msk0 from any   to 224.0.0.0/3

block in  quick on msk0 from 192.168.0.0/16to any
block in  quick on msk0 from 172.16.0.0/12 to any
block in  quick on msk0 from 10.0.0.0/8to any
block in  quick on msk0 from 127.0.0.0/8   to any
block in  quick on msk0 from 0.0.0.0/8 to any
block in  quick on msk0 from 169.254.0.0/16to any
block in  quick on msk0 from 192.0.2.0/24  to any
block in  quick on msk0 from 204.152.64.0/23   to any
block in  quick on msk0 from 224.0.0.0/3   to any

# 
# Block and log portmapper attempts.
block in log quick on msk0 proto tcp/udp from any to any port = 111 keep state

# 
# Allow outbound state related packets.
pass  out quick on msk0 proto tcp from any to any flags S keep state
pass  out quick on msk0 proto udp from any to any keep state

# 
# Allow ping and traceroute.  Since we're doing everything quick,
# we must have passes before blocks.
pass  in quick on msk0 proto icmp from any to any icmp-type  0 keep state
pass  in quick on msk0 proto icmp from any to any icmp-type  8 keep state
pass  in quick on msk0 proto icmp from any to any icmp-type 11 keep state
pass out quick on msk0 proto icmp from any to any icmp-type  0 keep state
pass out quick on msk0 proto icmp from any to any icmp-type  8 keep state
pass out quick on msk0 proto icmp from any to any icmp-type 11 keep state
block in log quick on msk0 proto icmp from any to any

# 
# Allow DNS; should this be just from nameservers?
pass in quick on msk0 proto tcp from any to any port = 53 flags S keep state
pass in quick on msk0 proto udp from any to any port = 53 keep state

# 
# Allow ssh and mail from anywhere: tcpserver filters addresses
pass in quick on msk0 proto tcp from any to any port = 22 flags S keep state
pass in quick on msk0 proto tcp from any to any port = 25 flags S keep state

# 
# Allow http from selected addresses.
pass in quick on msk0 proto tcp from 1.2.3.4 to any port = 80 flags S keep state
pass in quick on msk0 proto tcp from 1.2.3.5 to any port = 80 flags S keep state

# 
# Allow secure http from selected addresses.
pass in quick on msk0 proto 

Re: easy Firewall setup

2011-07-31 Thread Antonio Olivares
On Sun, Jul 31, 2011 at 11:15 AM, Antonio Olivares
olivares14...@gmail.com wrote:
 A Is there an easy firewall setup available somewhere (like the one
 A referenced below but for FreeBSD)?

   Here's a script you can use to generate a rules file for IPF.

 --

 Karl,

 I have used your script and it generated me a nice ipf.rules file

 /* ipf.rules /
 quadcore# cat /etc/ipf.rules
 # Generated by make-ipf-rules v1.10 at Sun Jul 31 10:42:21 CDT 2011
 #
 # NAME:
 #    /etc/ipf.rules
 #
 # DESCRIPTION:
 #    Ruleset for IPF packet filter.
 #
 # AUTHOR:
 #    Antonio Olivares olivares14...@gmail.com

 # 
 # We don't care about NETBIOS broadcast crap, bootpc requests, or IGMP.
 block in quick on msk0 proto udp  from any to any port = 68
 block in quick on msk0 proto udp  from any to any port = 137
 block in quick on msk0 proto udp  from any to any port = 138
 block in quick on msk0 proto igmp from any to any

 # 
 # Now block everything coming down the network.
 block in  log  on msk0 all
 block out log  on msk0 all

 # 
 # Get rid of anything with options, as these can be used to hack.
 block in  log quick     from any to any with ipopts

 # 
 # Get rid of short TCP/IP fragments (too small for valid comparison)
 # as these can be used to hack.
 block in  log quick proto tcp from any to any with short

 # 
 # Allow all traffic on loopback.
 pass  in  quick on lo0 all
 pass  out quick on lo0 all

 # 
 # Block all the private routable addresses, as these should never
 # come down the network, nor should we be talking to them.
 block out quick on msk0 from any               to 192.168.0.0/16
 block out quick on msk0 from any               to 172.16.0.0/12
 block out quick on msk0 from any               to 127.0.0.0/8
 block out quick on msk0 from any               to 10.0.0.0/8
 block out quick on msk0 from any               to 0.0.0.0/8
 block out quick on msk0 from any               to 169.254.0.0/16
 block out quick on msk0 from any               to 192.0.2.0/24
 block out quick on msk0 from any               to 204.152.64.0/23
 block out quick on msk0 from any               to 224.0.0.0/3

 block in  quick on msk0 from 192.168.0.0/16    to any
 block in  quick on msk0 from 172.16.0.0/12     to any
 block in  quick on msk0 from 10.0.0.0/8        to any
 block in  quick on msk0 from 127.0.0.0/8       to any
 block in  quick on msk0 from 0.0.0.0/8         to any
 block in  quick on msk0 from 169.254.0.0/16    to any
 block in  quick on msk0 from 192.0.2.0/24      to any
 block in  quick on msk0 from 204.152.64.0/23   to any
 block in  quick on msk0 from 224.0.0.0/3       to any

 # 
 # Block and log portmapper attempts.
 block in log quick on msk0 proto tcp/udp from any to any port = 111 keep state

 # 
 # Allow outbound state related packets.
 pass  out quick on msk0 proto tcp from any to any flags S keep state
 pass  out quick on msk0 proto udp from any to any keep state

 # 
 # Allow ping and traceroute.  Since we're doing everything quick,
 # we must have passes before blocks.
 pass  in quick on msk0 proto icmp from any to any icmp-type  0 keep state
 pass  in quick on msk0 proto icmp from any to any icmp-type  8 keep state
 pass  in quick on msk0 proto icmp from any to any icmp-type 11 keep state
 pass out quick on msk0 proto icmp from any to any icmp-type  0 keep state
 pass out quick on msk0 proto icmp from any to any icmp-type  8 keep state
 pass out quick on msk0 proto icmp from any to any icmp-type 11 keep state
 block in log quick on msk0 proto icmp from any to any

 # 
 # Allow DNS; should this be just from nameservers?
 pass in quick on msk0 proto tcp from any to any port = 53 flags S keep state
 pass in quick on msk0 proto udp from any to any port = 53 keep state

 # 
 # Allow ssh and mail from anywhere: tcpserver filters addresses
 pass in quick on msk0 proto tcp from any to any port = 22 flags S keep state
 pass in quick on msk0 proto tcp from any to any port = 25 flags S keep state

 # 
 # Allow http from selected addresses.
 pass in quick on msk0 proto tcp from 1.2.3.4 to any port = 80 flags S keep 
 state
 pass in quick on msk0 proto tcp from 1.2.3.5 to any port 

Phenom II 975 BE shows 0 celsius

2011-07-31 Thread Mario Lobo
Hi to all

In my desktop machine, I had an AM2+ ASROCK mobo with Phenom II 955 BE that 
showed each core temperature perfectly under FBSD 8-STABLE, via 
dev.cpu.x.temp. amdtemp.ko loaded.

Unfortunately this Mobo died and only found AM3 boards for which my phenom 955 
doesn't fit. So I got an ASUS M4A88T-V EVO with a Phenom II 975 BE. 

Funny thing. An AM3 phenom II fits on an AM2 board but an AM3 board doesn't 
accept an AM2/AM2+ phenom II :(.

Anyway, now, under the very same system, it shows 0 degrees on dev.cpu.x.temp 
for all cores.

I've been looking through k8temp and amdtemp src code. I am definitely not 
sure of this but I believe something might have happened to those:

From k8temp.h

K10_THERM_REG  0xa4 
K10_THERMTRIP_REG  0xe4
K10_CURTMP(val)(((val)  21)  0xfff)
K10_THERMTRIP(val) ((val  1)  1)

From amdtemp.c

/*
 * Register control (K8 family)
 */
#define AMDTEMP_REG0F   0xe4
#define AMDTEMP_REG_SELSENSOR   0x40
#define AMDTEMP_REG_SELCORE 0x04

/*
 * Register control (K10  K11) family
 */
#define AMDTEMP_REG 0xa4


Output of k8temp -dn:

CPUID: Vendor: AuthenticAMD, 0x100f43: Model=04 Family=f+1 Stepping=3
Advanced Power Management=0x1f9
   Temperature sensor: Yes
 Frequency ID control: No
   Voltage ID control: No
THERMTRIP support: Yes
   HW Thermal control: Yes
   SW Thermal control: Yes
   100MHz multipliers: Yes
   HW P-State control: Yes
TSC Invariant: Yes
Temp=c0fef
ThermTrip=1fc00c30
0

I keep a small win7 partition to test little things like this and see if the 
same thing happens there, and it doesn't, so I concluded that the sensors are 
there and are working.

One thing is worth noting though. I have used a free gadget that shows 
activity/temp for each core. It worked fine with the previous MB/CPU.That ALSO 
stopped working with this new MB. Like FBSD, it shows 0 degrees for any core 
too, although it correctly displays each core load.

The only windows tool that correctly shows the temperature are the ASUS tools 
that came with the mobo.

Other than that, everything is working fine! The only thing I had to fix was 
the fstab ada location.

I know this is not a big thing but I got accustomed to keeping an eye on those 
temperatures.

I have googled for a few days now searching for Thermal register address or 
offsets for the Phenom II 975 BE, or anything related to this problem and 
found nothing. Every search on AMD site was fruitless. I could not find a 
single bit of tech info on this processor there, or any other tech info for 
that matter.


Would any one have any pointers/clues/suggestions on this?

Thanks,
-- 
Mario Lobo
http://www.mallavoodoo.com.br
FreeBSD since 2.2.8 [not Pro-Audio YET!!] (99% winblows FREE)
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't build teTeX port in FreeBSD 8.2 amd64

2011-07-31 Thread Antonio Olivares
 If you are using TeXLive, first check if a TeXLive package for what you want
 exists. First tell tlmgr(1) to use a CTAN mirror:

    tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet

 Then list all packages available:

    tlmgr list|less

 The packages you have installed are prefixed with an 'i'.

 Am taking a look at TDS, but still confused :(

 Make a texmf directory in your $HOME. This is searched by default in TeXLive.
 See /usr/local/texlive/YEAR/texmf/web2c/texmf.cnf

 Just unzip pgfCVS2010-09-28_TDS.zip in ~/texmf, and run mktexlsr afterwards.

 Roland
 --

Roland,

I was finally able to compile this one with tikz stuff :) but with
texlive2010 not with teTeX from ports(yet).

Followed your suggestions, except that I did a global install of pgf
file in /usr/local/texlive/2010/texmf/ folder, copied pgf zip file
there and unzipped it, ran mktexlsr as root and finally had to snatch
picnic.sty

http://www.ctan.org/tex-archive/macros/latex209/contrib/picins

then it worked.  I might have to try something similar with the teTeX
system but it looks more complicated, there are more files and where
should I place them so that everything falls into place?  Anyhow,
thanks for the suggestions.

Regards,

Antonio
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: can't build teTeX port in FreeBSD 8.2 amd64

2011-07-31 Thread Antonio Olivares
 http://pastebin.com/23RCus2a

 http://tobi.oetiker.ch/lshort/lshort-5.01.src.tar.gz

 ran gmake and I see the errors.


One error is that in src/ folder, the file lshort-letter.tex does not
exist :(, if we cd to that folder and copy the lshort-a5.tex
lshort-letter.tex then it will build provided most of the other
files(sty) are found and no error occurs.  That is one solution, the
other could be editing the Makefile (to not build the
lshort-letter.pdf).  This lshort was able to build with the fix but on
TeXLive not yet with teTeX :(, will see which files I need first then
get back to compiling it fully and hopefully I can succeed as well.

Regards,

Antonio
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org