# Sending Message for EyeTracker using Pylinkwrapper

**URL:** https://discourse.psychopy.org/t/sending-message-for-eyetracker-using-pylinkwrapper/3013
**Category:** Coding
**Tags:** eyetracking
**Created:** [September 7, 2017, 1:15am UTC](https://discourse.psychopy.org/t/sending-message-for-eyetracker-using-pylinkwrapper/3013 "2017-09-07T01:15:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Eliya\_Ben-Asher](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/eliya_ben-asher/32/1558_2.png) [@Eliya\_Ben-Asher](https://discourse.psychopy.org/u/Eliya_Ben-Asher)
#### Post date: [September 7, 2017, 1:15am UTC](https://discourse.psychopy.org/t/sending-message-for-eyetracker-using-pylinkwrapper/3013/1 "2017-09-07T01:15:44Z")

</div>

Hi,

I am trying to send a message for my experiment using Connector (pylinkwrapper) so I can identify my cue and target side for each trial.  
I have looked up everything online and for some reason whenever I write tracker.send\_message or tracker.sendMessage (it also doesn’t work with setting status/trialid) I keep getting this error. If anyone knows what’s wrong I would greatly appreciate the help!

![error](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/d/3/d319935303c4da67b236ef1c959fe60e6dad74b1.png)

![example1](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/e/b/eb46eb6c3e41b30bc32172fcbf501df8fdd20f62.png)

\*note: I tried during tracker.sendMessage as well but got the same error

---

<div class="post-metadata">

### Author: ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)
#### Post date: [September 7, 2017, 7:14am UTC](https://discourse.psychopy.org/t/sending-message-for-eyetracker-using-pylinkwrapper/3013/2 "2017-09-07T07:14:03Z")

</div>

I’m not familiar with Pylinkwrapper. What class of object is `tracker` supposed to be? Currently it is an instance of the `Connect` class, whatever that is. Does the Pylinkwrapper API tell you what `tracker` should be?

Perhaps show us the line where you create the `tracker` object.

---

<div class="post-metadata">

### Author: ![Eliya\_Ben-Asher](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/eliya_ben-asher/32/1558_2.png) [@Eliya\_Ben-Asher](https://discourse.psychopy.org/u/Eliya_Ben-Asher)
#### Post date: [September 7, 2017, 4:00pm UTC](https://discourse.psychopy.org/t/sending-message-for-eyetracker-using-pylinkwrapper/3013/3 "2017-09-07T16:00:55Z")

</div>

Here where I set up ‘tracker’ and it seems to work with other functions in the code, so I’m not sure what’s going on with the message and setting trial info. ![eyelink](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/4/7/470b80e12b94ecd72f3a36038e3778f23f99b1e1.png)

---

<div class="post-metadata">

### Author: ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)
#### Post date: [September 7, 2017, 11:12pm UTC](https://discourse.psychopy.org/t/sending-message-for-eyetracker-using-pylinkwrapper/3013/4 "2017-09-07T23:12:02Z")

</div>

According to the docs at [Sample Experiment — pylinkwrapper 1.0 documentation](http://pylinkwrapper.readthedocs.io/en/stable/sample.html), creating a connection to the tracker should look like this:

```auto
import pylinkwrapper

# Initiate eye-tracker link and open EDF
tracker = pylinkwrapper.connect(win, '1_test') 

```

This should result in `tracker` being an instance of the `Connector` class, whereas your error indicates that you have a `Connect` object. Again, I don’t know the API, but this seems like an issue.

PS instead of going to the effort of taking screenshots of code, could you please just paste in the text and do this to get it formatted properly:

> [@Please surround python code with backticks](https://discourse.psychopy.org/t/please-surround-python-code-with-backticks/1775):
>
> When you include python code on this forum please put triple “backticks” like this ``` on the line before and the line after your code. If you’ve done it correctly then your code will appear in a grey box with correct indentation like this (check the preview of your post on the right hand side before posting it) and other people will be better able to work out what might be right/wrong with your code. if myVal==True: break If you’ve already posted something that didn’t follow this rule th…

This makes it easier for people to copy your code and suggest edits.
