Show Posts
Pages: 1 ... 48 49 [50] 51 52 ... 150
736  Using Arduino / Networking, Protocols, and Devices / Re: What is the "latest.txt" file? on: January 18, 2014, 12:13:07 am
Latest stable version I guess.

Remember the pre 1.0 versions were 4 digits ( 0022 ).
The IDE peeps might have once wanted to put in an "check for updates" feature.
Seems like it was updated around the time of the 105 release.

Last-Modified: Wed, 02 Oct 2013 13:46:55 GMT
737  Using Arduino / Networking, Protocols, and Devices / Re: DhcpAddressPrinter error on: January 16, 2014, 09:41:19 am
I don't use the ICS features for this, well not directly anyway.

In windows 7 go to your 'network sharing center'
On the left click 'Change adapter settings'

There you will see an icon for your wifi and an icon for your LAN.
Right click the LAN and select bridge connections.
Select both icons and right click -> 'bridge connections'

Once done, your Arduino can use DHCP from the router your laptop connects to.
738  Using Arduino / Networking, Protocols, and Devices / Re: How to get remote IP without modding the core. on: January 16, 2014, 07:43:26 am
If it were added to the Client class, it would have to be a virtual function. This would break all existing classes that derive from Client.
739  Using Arduino / Programming Questions / Re: Bitshifting Isn't Working right. on: January 16, 2014, 02:12:05 am
Where is the rest of your code, I can only guess that testData is even an integer type.

Your output does not look like it came from that code.

for(int i=0; i<8; i++){
   testData = testData >> i;

You print the initial value and shift 0 bits in the first iteration. Your output should contain the starting value twice when the second iteration prints the data.
740  Using Arduino / Programming Questions / Re: "precompiled headers" problem - how to force recompilation? on: January 16, 2014, 01:16:11 am
There is no need for run time control over a compile time constant. Using templates you can achieve what you want. Depending on how the library is structured, it may be very simple.

What is the library you are using. Searching finds pinChangeInt.h not pinChange.h. I'll give an example if I can find it.

As it stands, the libraries are compiled first which is why only the header can see the change you made to the define ( your sketch is not used to compile cpp library files ). Using templates makes the library dependent on your code.
741  Using Arduino / Networking, Protocols, and Devices / Re: How to get remote IP without modding the core. on: January 15, 2014, 07:37:37 am
I agree its a feature that should be built in.

The point of providing it as a sit on top feature is for portability/compatibility reasons. Possibly even the same reason you had for this post:

When its added into the core then great, no need for a fix, however there is also now no need for delving into the Ethernet library until that time arrives.

I also pointed out it was for the Ethernet shield. After your experience ( and liudr ) with the Wifi shield, I don't think I'll have one for a while to even test.
742  Using Arduino / Networking, Protocols, and Devices / Re: How to get remote IP without modding the core. on: January 15, 2014, 07:20:49 am
I understand this, however my version does not require modification to the core, or its libraries, whereas the method yourself and I linked both require the core to be changed in some way.
743  Using Arduino / Networking, Protocols, and Devices / How to get remote IP without modding the core. on: January 15, 2014, 07:01:05 am
People should never write open source libraries with private data members in classes, as you may know, this prevents you from deriving the class and adding your own extensions to it. This is what has happened to the Ethernet library, you cannot access private members needed to retrieve the remote IP.

You can mod the core yourself ( and every time you update the IDE ) using the intructions here:

However I have a tiny library for use with your Arduino Ethernet shield projects that allows you to get this information without modifying the core libraries.

There is one function RemoteIP, it takes a reference to an EthernetClient object and returns an IPAddress object.
The IPAddress structure is part of the core and is printable.


EthernetClient client = server.available();

Serial.print( "Remote IP: );
Serial.println( RemoteIP( client ) );

The library, create a new library folder called EthernetFix and a .h file with the same name. Then copy the code below into it.
You can just copy it into the sketch, however a library is more convenient for multiple projects.
Code: (EthernetFix.h)
//Requires your sketch to include Ethernet.h
#include <Arduino.h>
#include <utility/w5100.h>

template<typename Tag, typename Tag::type M>
  struct AccessMember{
    friend typename Tag::type get( Tag ){ return M; }

struct EthernetClient_Socket{
  typedef uint8_t EthernetClient::*type;
  friend type get( EthernetClient_Socket );

template struct AccessMember< EthernetClient_Socket, &EthernetClient::_sock >;

IPAddress RemoteIP( EthernetClient &c ){
  byte remoteIP[ 4 ];
  W5100.readSnDIPR( c.*get( EthernetClient_Socket() ), remoteIP );
  return ( remoteIP );

Using the output from surfer tims web server I got this result:
Client request #1: GET / HTTP/1.1
file = /
file type =
method = GET
params =
protocol = HTTP/1.1
Remote IP:
Home page SD file
filename format ok
File not found
SRAM = 6483
SRAM = 6483

Happy programming!

NOTE: To use the library in multiple C++ files you may need to move the RemoteIP function to a cpp file with only the prototype in the header. Ask if you need help with this.
744  Products / Arduino Yún / Re: Uploading sketch via Ethernet on: January 13, 2014, 12:22:34 am
If you use a dish, you do not need to connect the yun to it, simply sit it in the middle. This will reflect some energy that would normally head in the opposite direction to your router.

The Ethernet over power line and POE seem like good alternatives.
745  Products / Arduino Yún / Re: Uploading sketch via Ethernet on: January 11, 2014, 09:09:42 pm
Add a directional antenna to your router and yun.

I Cut a lid for a 100 spool of CD's in half and lined it with foil, works quite well with my router. Not sure about the yun, maybe put the whole device in the middle of dish.
746  Community / Bar Sport / Re: Million-and-one noob q:s about Programmers, Programs, Programming and Pragmatism on: January 11, 2014, 08:36:44 pm
As for loop and setup, there is no need to re-write main.h/.cpp if you use the IDE or .cpp files in another compiler. C++ supports function overloading so you can simply provide your own int main() in your local files.

I have started an article on using int main() in relation to the IDE:
747  Development / Other Software Development / Re: Sublime Text and Stino: Best IDE you can have. on: January 11, 2014, 07:34:40 pm
SPI_CONTINUE and SPI_LAST do not appear to be in the Arduino package ( 1.0.5 ). You might have left out/improperly included a library and/or sublime might not define something that is used to conditionally include the SPI_x symbols.
748  Using Arduino / Programming Questions / Re: does not name a type problem on: January 11, 2014, 04:20:54 am
Don't mix case!!!

Switch != switch

You can't use switch as it is reserved, your library folder must be Switch, same as the header and source files.
749  Development / Other Software Development / Re: Simulator for Arduino v0.98 on: January 11, 2014, 03:32:59 am
Does the 150 lines include empty or small lines ( maybe a single bracket ) or libraries?
750  Using Arduino / Project Guidance / Re: Arduino Error "error: 'class _Esplora' has no member named 'readTK' " on: January 11, 2014, 03:24:38 am
What is your code, I can only assume the code below, which has no problems compiling:

#include <Esplora.h>

void setup() {}

void loop() {}

There is no readTK in the Esplora library (1.5.2), you must have that symbol somewhere in your code. Have you also changed the board type to Esplora?
Pages: 1 ... 48 49 [50] 51 52 ... 150