Show Posts
Pages: [1] 2 3 ... 67
1  Using Arduino / Programming Questions / Re: Download file via HTTP-request/response on: January 21, 2014, 07:42:09 pm
Try leaving out the Content-length: header line entirely.  It is optional in the HTTP spec.

The bitlash web server doesn't send content-length: https://github.com/billroy/bitlash/blob/master/examples/BitlashWebServer/BitlashWebServer.ino

Be sure to close the client connection after writing your last byte, since this is the only way the other end will have to know the response body is finished.

-br
2  Using Arduino / Programming Questions / Re: Download file via HTTP-request/response on: January 20, 2014, 05:11:03 pm
Headers must have a colon separating them from the rest of the line.

Try this:
Code:
Content-disposition: attachment;filename="myfile.csv"

-br
3  General Category / General Discussion / Re: Morse Code blinker on: December 15, 2013, 07:35:05 am
For reference and discussion, here is an implementation of an Arduino Morse code generator that uses an array to specify the letter signatures:

     https://github.com/billroy/bitlash/blob/master/examples/morse2/morse2.pde#l125

The m() define is used to pack both the dit and dah elements (as 0 and 1) and the length of the character in elements into a single byte in the array. 

Using three bits for the count leaves room for five Morse elements.  This handles most cases, but because there are several Morse characters with six elements, there is also an overflow table (outliers) to define those characters.

-br
http://bitlash.net
4  Using Arduino / Microcontrollers / Re: Linking Arduino with Ubuntu without the Arduino's IDE on: November 24, 2013, 10:28:56 am
When you open the serial port, the Arduino resets and enters the boot loader to see if you want to upload a new program.

If you send data during this interval, it is eaten by the bootloader, because your program hasn’t started yet.  This is likely what is happening for you.

Try waiting one or two seconds after opening the serial port before writing to it.  That will give the bootloader time to time out and start your program.

Even better would be to wait for a “ready” signal from the program itself.

Hope that helps,

-br
5  Using Arduino / Programming Questions / Re: bitlash without serial port on: November 16, 2013, 06:45:59 am
Happy to try to help.  I read the translation of your Russian page and it looks like an interesting project.

Could you please post your code, at least the sketch that is using Bitlash?  And it would be helpful to have a little more information about  the problem:  what is the test situation, what do you expect to see, and what are you actually seeing?

Thanks,

-br
http://bitlash.net
6  Using Arduino / Networking, Protocols, and Devices / Re: Arduino serial messaging protocol on: November 03, 2013, 07:43:24 am
Thanks for your post, and for sharing your project.  It's an interesting problem, isn't it?  

The approaches taken by Arduino-serial-messaging and Firmata are both valid and effective, but may I suggest you also consider Bitlash?  (http://bitlash.net)   Bitlash is an interpreted language that runs on the Arduino and provides the affordances of a mini development environment.  Having a development capability on the device offers arbitrary extensibility at run time, and the control "protocol" is just statements in the Bitlash language, sent from the PC.  This offers excellent visibility into the communication flow, without special tooling, which is arguably a strong plus in an educational environment.

Bitlash is syntactically a stepping-stone to C, is easy to teach, and easy to learn.  If distributed system design is part of your curriculum, it puts enough remotely-programmable intelligence on the device that you can explore a spectrum of options as to partitioning functionality between the PC and the endpoints.

Documentation at http://bitlash.net, code at https://github.com/billroy/bitlash

Kind regards,

-br
7  Using Arduino / Project Guidance / Re: bitlash and rcswitch library on: October 12, 2013, 03:04:36 pm
Cool project.  The interrupts shouldn't have any effect on Bitlash except to slow it down a wee bit.  So you should be okay.  Same for reading from the SD card.

Good luck with your project,

-br
8  Using Arduino / Programming Questions / Re: How to restrict Arduino webserver to respond only to particular web site on: September 29, 2013, 03:45:09 pm
The information you need is sent in what is called the "Referrer header": http://en.wikipedia.org/wiki/HTTP_referer

The browser includes this header in the HTTP request to the server when it fetches a page in response to a click on a link.

You can read and parse the Referrer: header data from the HTTP request to your Arduino and confirm it matches the domain you wish to limit access to.

-br
9  Using Arduino / Displays / Re: bitlash + Normal Hitachi HD44780 Compatibe LCD (4x20) + PS2 Keyboard on: September 14, 2013, 06:47:58 am
I am the author of Bitlash and would be glad to help.

To integrate the keyboard input, send each character your keyboard driver receives to the Bitlash "doCharacter(char c)" routine.

To integrate the display output, you can use "setOutputHandler(&yourDisplayHandler);".  This redirects all of the Bitlash serial output to the function you specify.  Output is sent one character at a time.  The loudbitlash example shows a simple case using setOutputHandler.

Hope that is helpful, and good luck with your project,

-br
10  Using Arduino / Programming Questions / Re: Going back to loop after hardware interrupt on: July 29, 2013, 08:29:59 am
Checking a global flag and exiting in the innermost loop of your pattern generators is the best way to cleanly transition between patterns.

If you really want to kludge the restart, look into using the watchdog timer to reboot the processor, and use the EEPROM to save which pattern you want for the next boot cycle.

-br



11  Using Arduino / Programming Questions / Re: Delayed response from webservers action driven links on: July 06, 2013, 06:48:14 pm
This may not be the bug you're after, but it looks like a problem:
Code:

       if (currentLine.endsWith("GET /LS") == 1 || currentLine.endsWith("Get /LS") == 1){
               ...
        }

        if (currentLine.endsWith("GET /L") == 1 ||02 currentLine.endsWith("Get /L") == 1) {
             ...
        }

An input ending with "GET /LS" will fall into the first case, and then also fall into the second case.  Which may not be what you want.

Shouldn't that whole sequence be a chain of if-else if tests, so that only one is executed?

-br


12  Using Arduino / Programming Questions / Re: want to start using millis for non-blocking - which of the libraries is best ? on: July 05, 2013, 06:28:27 am
Not Mary, but I do have a simple library to offer: https://github.com/billroy/run

The advice to roll your own is good advice, but it never hurts to look at another implementation.  Use that code for ideas.

Good luck with your project,


-br
13  Community / Website and Forum / RSS feed stopped working! on: May 15, 2013, 09:38:54 am
The RSS feed for forum posts went off the air when the forum went down recently and hasn't returned.

I would really like to see the full feed of new posts available via RSS.  Please?

If the Administrators are listening, help!


-br
14  Using Arduino / Project Guidance / Re: Keypad+LCD+multi-passcodes doable with UNO? on: May 11, 2013, 07:27:28 pm
What you are describing is doable, within limits.  The passcode list you can keep with the code in PROGMEM, or in EEPROM.  You can log to EEPROM, but there are only 1024 bytes to work with, so it's not much of a log.

For bigger logs it's popular to use SD card or an attached network device to log to a server.

-br
15  Using Arduino / Programming Questions / Re: Communication with the PC problem! on: May 11, 2013, 03:07:28 pm
It might work better if you call pinMode() in setup to set the LED pin as an output.

-br
Pages: [1] 2 3 ... 67