PDA

View Full Version : Teensyduino 1.27 Beta #1 Available



Paul
12-17-2015, 10:59 PM
Here is a first beta test for Teensyduino 1.27.


Edit: old beta test linkes removed. Full non-beta release is here:
http://www.pjrc.com/teensy/td_download.html



The version adds support for Arduino 1.6.7.

defragster
12-18-2015, 06:01 AM
Paul: I pulled 1.27b1 down to my Win10 w/IDE 1.6.6 and compiled my recent serial and scrolling and touch examples - No problem.

One Issue with the TOUCH PULL. I'll go issue a new pull request ASAP. <edit: done> (https://github.com/PaulStoffregen/XPT2046_Touchscreen/pull/4)

I didn't see this on your merge but "#define Z_THRESHOLD_INT 75" got dropped or I did a bad pull request <edited> missing "#define Z_THRESHOLD 400" - this regularly leads to breaks in the interrupt functionality.

It was a specific fix that helped greatly taking 80 lines of 'sketch' code to 20 when I moved it native to the 'library', made the INT code stable and prevented forced "over reading". Since the interrupt only comes once per touch - any failed touch return (without this 'conditioning' below) prevents future readings [on that 'touch'], i.e. "isrWake = false". 400 is valid minimum for a real touch, but the hardware doesn't have that limitation - a touch is a touch. A light finger on its way to full pressure registers a light initial touch under 400, then ramps up. Likewise a sliding finger may go 'light' of 400 without 'untouching' Once the touch is rejected - the interrupt 'read/update() enable' [i.e. "if (!isrWake) return;"] is distinguished even though the touch never was 'lost' to the hardware to generate a new interrupt.

Admittedly the '75' is arbitrary though worked 100% in my testing after I picked it, and it returns to working as soon as I put code below back As soon as I uploaded the compiled 1.27b1 code I was seeing the failure to sense touch, with the lines below restored so was full functionality.



#define Z_THRESHOLD_INT 75

if (z < Z_THRESHOLD_INT) { // if ( !touched ) {
if (255 != tirqPin) isrWake = false;
}


<edit> On Win10 I've been using 1.6.6 so I decided to try 1.6.7 - TD_1.27b1 then installed properly to that fresh unzipped directory and recent sketches compile.

duff
12-21-2015, 03:55 AM
Is there a reason why this code gets a compile error, it worked with 1.25rc2. Or is this Arduino issue? Using Arduino 1.6.7 an this threads teensyduino for this error.



void setup() {
// put your setup code here, to run once:
}

void loop() {
// put your main code here, to run repeatedly:
}

#ifdef __cplusplus
extern "C" {
#endif

void test() {
Serial.println("test");
delay(1000);
}

#ifdef __cplusplus
}
#endif

error:


/var/folders/bj/vlzk0z7x3bqb_jzmz0k0vv2h0000gp/T/arduino_fa81b5de50bf36d94dd70f91df9696b7/sketch_dec20b.ino: In function 'void test()':
sketch_dec20b:15: error: previous declaration of 'void test()' with 'C++' linkage
void test() {
^
sketch_dec20b:15: error: conflicts with new declaration with 'C' linkage
void test() {
^
exit status 1
conflicts with new declaration with 'C' linkage


but this works:


#ifdef __cplusplus
extern "C" {
#endif

void test() {
Serial.println("test");
delay(1000);
}

#ifdef __cplusplus
}
#endif

void setup() {
// put your setup code here, to run once:
}

void loop() {
// put your main code here, to run repeatedly:
}


Also if I get error using the top c linkage code in a new tab.

PaulStoffregen
12-21-2015, 01:21 PM
Is there a reason why this code gets a compile error, it worked with 1.25rc2. Or is this Arduino issue?

Yup, they massively changed the build process in Arduino 1.6.7.

Most of the changes are a huge improvement, but automatically extracting function prototypes is still a bunch of tough trade-offs. Obviously ctags isn't very aware of "extern C".

You should probably move this sort of thing into its own .cpp and .h file. Long-term, that's the only way that's likely to keep working with all versions of Arduino.

mercyful
12-22-2015, 03:10 PM
Hello Paul,


Here is a first beta test for Teensyduino 1.27.
Mac OS-X:
http://www.pjrc.com/teensy/td_127-beta1/teensyduino.dmg
The version adds support for Arduino 1.6.7.

On Macosx 10.11.2 i cannot install teensyduino for 1.6.7 beta, as i get the following during installation:

Checking Arduino 1.6.7:
version: "Contents/Java/lib/version.txt" version matches
file: "Contents/MacOS/Arduino" present
file: "Contents/Info.plist" present
file: "Contents/Java/jssc-2.8.0.jar" present
java: "Contents/Java/pde.jar" object: "processing/app/Base.class" checksum mismatch, unsupported Arduino version
Does not match Arduino 1.6.7

More info:
>file Base.class
Base.class: compiled Java class data, version 52.0


>javap -verbose Base
Classfile /Applications/Arduino.app/Contents/Java/pde/processing/app/Base.class
Last modified Dec 22, 2015; size 62548 bytes
MD5 checksum 9d539363803959432bd4b1a6dbf3bd54
Compiled from "Base.java"
public class processing.app.Base
SourceFile: "Base.java"
InnerClasses:
[cut]


>java -version
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)

Greetings

PaulStoffregen
12-22-2015, 06:27 PM
On Macosx 10.11.2 i cannot install teensyduino for 1.6.7 beta, as i get the following during installation:


They updated the mac version this morning. That's a good thing. The mac version they've had for download these last few days has a mysterious difference from the published source code.

I'll prepare 1.27-beta2 soon.

defragster
12-22-2015, 06:34 PM
I'll prepare 1.27-beta2 soon.

Paul: can you look at including my TouchScreen Interrupt pull (post #2) for beta #2? It seems my weak GitHub skills got you an incomplete version the other week. Without that the int code is inclined to give disappointing results.

mortonkopf
12-22-2015, 06:55 PM
for those using FastLED, there is still an issue with compile errors for 1.6.6 on for Teensy 3. Had to go back to 1.6.5.
https://github.com/FastLED/FastLED/issues/234

Headroom
12-24-2015, 03:38 PM
The multicast support provided by the standard Arduino Ethernet library is missing from the Ethernet library provided by Teensyduino 1.2.7b.
I've updated the EthernetBonjour library (https://github.com/TrippyLighting/EthernetBonjour) to work with Arduino 1.6.6 out of the box and it wold be nice to see this in Teensyduino as well ;-)

PaulStoffregen
12-27-2015, 01:52 AM
I've updated the EthernetBonjour library (https://github.com/TrippyLighting/EthernetBonjour) to work with Arduino 1.6.6 out of the box and it wold be nice to see this in Teensyduino as well ;-)

I merged a ton of updates to Teensyduino's Ethernet library.

https://github.com/PaulStoffregen/Ethernet

I tested several of the examples and things seem to be working. Some of the API updates I can't really test because none of the examples use them.

I compiled EthernetBonjour's DiscoveringServices example and it's running, but not discovering anything on my network. I'm really not familiar with how it works or what string I need to give it.

Please give this updated Ethernet a try and let me know how it works for you?

Headroom
12-27-2015, 03:00 AM
I've tested the service discovery and it works here.
My network router is an Airport Time Capsule and the Bonjour browser on my iMac shows these Bonjour services to be available:
5906

So if you have the sketch look for _http or _ sbm or _atp it will discover these services.



>>Send to /dev/tty.usbmodem451371: "_smb"<<
Discovering services of type '_smb' via Multi-Cast DNS (Bonjour)...
Found: 'Peter's AirPort Time Capsule' at 10.0.1.1, port 445 (TCP)
txt record: netbios=
Finished discovering services of type _smb

>>Send to /dev/tty.usbmodem451371: "_http"<<
Discovering services of type '_http' via Multi-Cast DNS (Bonjour)...
Found: 'EyeTV Peter Doering’s iMac' at 10.0.1.4, port 2170 (TCP)
txt record: path=/eyetv/
Finished discovering services of type _http

Headroom
12-27-2015, 03:06 AM
Registering a Bonjour service record, for example an OSC service (_osc._udp) works as well:



Connected to /dev/tty.usbmodem451371 at 9600
My MAC is: 04:E9:E5:00:B0:51
Starting Network using DHCP.
My IP is 10.0.1.32
Setting Bonjour Host Name : 04:E9:E5:00:B0:51.local
Bonjour Service Record added successfully



Thanks for adding this!!!

nlecaude
12-27-2015, 04:13 PM
The attachment doesn't seem to work...

Headroom
12-27-2015, 04:51 PM
It was just a screenshot of the Bonjour browser showing the registered service. Ive already deleted it ;-)

ratkins
12-28-2015, 11:41 AM
Here is a first beta test for Teensyduino 1.27.

Mac OS-X:
http://www.pjrc.com/teensy/td_127-beta1/teensyduino.dmg

The version adds support for Arduino 1.6.7.

I'm trying this with Arduino 1.6.7 on OS X 10.11.2. When I run the Teensyduino installer and select the Arduino directory the "Next" button of the installer stays ghosted. Clicking on "?", I get:


Directory: /Applications/Arduino-1.6.7.app/
Checking Arduino 1.0.6:
version: "Contents/Resources/Java/lib/version.txt" file missing
Does not match Arduino 1.0.6
Checking Arduino 1.6.1:
version: "Contents/Resources/Java/lib/version.txt" file missing
Does not match Arduino 1.6.1
Checking Arduino 1.6.3:
version: "Contents/Java/lib/version.txt" wrong version: 1.6.7 Does not match Arduino 1.6.3
Checking Arduino 1.6.5-r5:
version: "Contents/Java/lib/version.txt" wrong version: 1.6.7 Does not match Arduino 1.6.5-r5
Checking Arduino 1.6.6:
version: "Contents/Java/lib/version.txt" wrong version: 1.6.7 Does not match Arduino 1.6.6
Checking Arduino 1.6.7:
version: "Contents/Java/lib/version.txt" version matches
file: "Contents/MacOS/Arduino" present
file: "Contents/Info.plist" present
file: "Contents/Java/jssc-2.8.0.jar" present
java: "Contents/Java/pde.jar" object: "processing/app/Base.class" checksum mismatch, unsupported Arduino version
Does not match Arduino 1.6.7

PaulStoffregen
12-28-2015, 11:43 AM
I'm trying this with Arduino 1.6.7 on OS X 10.11.2. When I run the Teensyduino installer and select the Arduino directory the "Next" button of the installer stays ghosted. Clicking on "?", I get:



java: "Contents/Java/pde.jar" object: "processing/app/Base.class" checksum mismatch, unsupported Arduino version
Does not match Arduino 1.6.7


Use 1.27-beta2.

https://forum.pjrc.com/threads/32273-Teensyduino-1-27-Beta-2-Available

PaulStoffregen
01-04-2016, 11:56 AM
@Headroom - Any chance you could give my latest edits to Ethernet a try? I don't have any realistic way to test if UDP multicast is working.

https://github.com/PaulStoffregen/Ethernet

Over the last few days, I've made some major changes & optimizations. TCP should be much faster, especially for the case of reading 1 byte at a time.

Headroom
01-05-2016, 01:02 AM
I have not tested intensely, but Bonjour service registration per UDP multicast and OSC protocol per UDP transfer function fine.
This was tested against Arduino 1.6.6 and the Arduino Eclipse plugin as I mainly have stopped working with Arduino IDE.

nlecaude
01-07-2016, 02:54 PM
I just tried Arduino 1.6.7 with Teensyduino 1.27 and Paul's new Ethernet library on github and I can't get the EthernetBonjour Library to work at all.
I tried the RegisteringServices example and it doesn't seem to register and I can't ping the device.

Any ideas ?

I do get some warnings when compiling:



/Users/nathanaell/Documents/Arduino/libraries/EthernetBonjour/EthernetBonjour.cpp: In member function 'MDNSError_t EthernetBonjourClass::_sendMDNSMessage(uint32_t, uint32_t, int, int)':
/Users/nathanaell/Documents/Arduino/libraries/EthernetBonjour/EthernetBonjour.cpp:488:1: warning: label 'errorReturn' defined but not used [-Wunused-label]
errorReturn:
^
/Users/nathanaell/Documents/Arduino/libraries/EthernetBonjour/EthernetBonjour.cpp: In member function 'MDNSError_t EthernetBonjourClass::_processMDNSQuery()':
/Users/nathanaell/Documents/Arduino/libraries/EthernetBonjour/EthernetBonjour.cpp:619:48: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ir = (tr > sizeof(DNSHeader_t)) ? sizeof(DNSHeader_t) : tr;
^
/Users/nathanaell/Documents/Arduino/libraries/EthernetBonjour/EthernetBonjour.cpp:761:54: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ir = (tr > sizeof(DNSHeader_t)) ? sizeof(DNSHeader_t) : tr;
^
/Users/nathanaell/Documents/Arduino/libraries/EthernetBonjour/EthernetBonjour.cpp:854:54: warning: value computed is not used [-Wunused-value]
ptrName[buf[0]]; // this catches uncompressed names
^
/Users/nathanaell/Documents/Arduino/libraries/EthernetBonjour/EthernetBonjour.cpp:854:54: warning: statement has no effect [-Wunused-value]
/Users/nathanaell/Documents/Arduino/libraries/EthernetBonjour/EthernetBonjour.cpp:1031:103: warning: 'xid' may be used uninitialized in this function [-Wmaybe-uninitialized]
(void)this->_sendMDNSMessage(this->remoteIP(), xid, (int)MDNSPacketTypeServiceRecord, j-2);
^
/Users/nathanaell/Documents/Arduino/libraries/EthernetBonjour/utility/EthernetUtil.c:64:0: warning: ignoring #pragma mark [-Wunknown-pragmas]
#pragma mark -
^
/Users/nathanaell/Documents/Arduino/libraries/EthernetBonjour/utility/EthernetUtil.c:65:0: warning: ignoring #pragma mark Private [-Wunknown-pragmas]
#pragma mark Private
^
Plusieurs bibliothèque trouvées pour "Ethernet.h"
Utilisé : /Users/nathanaell/Documents/Arduino/libraries/Ethernet
Non utilisé : /Applications/Arduino.app/Contents/Java/hardware/teensy/avr/libraries/Ethernet
Non utilisé : /Applications/Arduino.app/Contents/Java/libraries/Ethernet

nlecaude
01-07-2016, 03:03 PM
Update:
Using the standard Ethernet library in 1.6.7 I could get the library to work but it doesn't seem to work with Paul's latest version.

PaulStoffregen
01-08-2016, 03:07 PM
I'm not very familiar with the Bonjour protocol. I do have some Apple devices that use it for network discovery. I also have an Arduino Yun.

Can you give me any hints about how I might use these and examples from that library?

nlecaude
01-08-2016, 03:50 PM
The most simple way to test is to run this example: https://github.com/TrippyLighting/EthernetBonjour/blob/master/examples/RegisteringServices/RegisteringServices.ino
If you have a mac around you can use the free Bonjour browser to see if the device gets registered on the Network: http://www.tildesoft.com/files/BonjourBrowser.dmg
From the mac you should also be able to ping the device by it's hostname (arduino.local)

Headroom
01-08-2016, 04:36 PM
@nleclaude, thanks for the help. I'll take a look at the examples and try to test against Arduino 1.6.7 tonight and over the weekend.
I usually don't work with the Arduino IDE but use the Arduino Eclipse IDE (mac user here ;-) so i am oftern a version or more behind in the Arduino IDE.

I have tested service registration successfully with Paul's updated Ethernet library against Arduino 1.6.6 using the Arduino Eclipse IDE but I have not tested it agains the Arduin 1.6.7 IDE.

My standard test rig is a Teensy 3.0 or 3.1 connected to a WIZ820io , which is connected per Ethernet cable to an recent Apple Airport Time Capsule. This I testet successfully with service registration (TCP & UDP) and service discovery.

I've also previously had success registering services connecting a wireless mini router to the WIZ820io but the service discovery did not work in that setup.

The Bonjour browser app is very helpful and is also available for the iPhone I believe..

Headroom
01-12-2016, 12:11 AM
I successfully tested two of the 4 examples from the Arduino EthernetBonjour library with Arduino 1.6.7 and Teensyduino 1.27 from the main download here (http://pjrc.com/teensy/td_download.html) (not from the beta threads from the forum). In both cases I simply loaded the code into the editor and compiled and uploaded to a Teensy 3.1 without any modifications. This tests the two main parts of Bonjour, service Registration via mDNS and service discovery vis DNS-SD.

1. The RegisteringServices.ino registers a _http._tcp service and a little web site called "Arduino Bonjour Webserver Example" shows up in Safari:

6079

When selected it simply displays text: "Hello from a Bonjour-enabled web-server running on your Arduino board!"
It shows up in the Bonjour Browser with the same name.

2. The DiscoverServices.ino attempts to find specific registered services on the network. The Bonjour Browser indicates which services are registered at the moment:

6080

To find these series, once the sketch is compiled and uploaded to the board, open the serial monitor and type one of the device types into the entry line and hit enter. For example "_http" will discover all http services:

6081

Here is a returned result:

6082

It works the same with _smb and _daap:

6083

This hopefully helps to test whether multicast works as expected.

manitou
01-26-2016, 01:56 PM
@Headroom - Any chance you could give my latest edits to Ethernet a try? I don't have any realistic way to test if UDP multicast is working.



you might look at installing/using iperf on your linux box. iperf can do multicast, see
https://gist.github.com/jayjanssen/5697813