AttributeError: module 'psychopy.iohub' has no attribute 'sendMessageEvent'

.

OS Windows 10
PsychoPy version (e.g. 1.84.x): 2023.1.3
What are you trying to achieve?:
I building an experimenting consisting of a cue phase, task phase, and feedback phase. Each of these phase has their own routine. The eyetracker I use is a Tobii ProFusion. In the past, I have successfully used modified custom code that sends a message event via ioHub to the HDF5 so that each collected sample in the data stream has trial and event information.
Here is the code in question, where trial and rewCond are variables

ioServer.sendMessageEvent(text=f"start_TRIAL-{trialNum_cumul}_EVENT-cue_CONDITION-{rewCond}") # start of the trial

To mark the end of the trial, the following custom code goes in the “End Routine” tab for that routine:
io.sendMessageEvent(text=f"end_TRIAL-{trialNum_cumul}_EVENT-cue_CONDITION-{rewCond}") # end of the trial

Error I Get:
The experiment crashes shortly after the cue phase and gives the following error:

File "C:\Experiments\vts_reward_mood_F23\vts_reward_mood_2023.1.3_Oct13_lastrun.py", line 4646, in <module>
    io.sendMessageEvent(text=f"end_TRIAL-{trialNum_cumul}_EVENT-cue_CONDITION-{rewCond}") # end of the trial
AttributeError: module 'psychopy.iohub' has no attribute 'sendMessageEvent'

What did you try to make it work?:

  1. Ensure Windows read/write permissions for the ioHub library in the PsychoPy program files
  2. Use the experiment settings to ‘downgrade’ to Psychopy (2022.2.5); this version has send.MessageEvent code and does not crash in an ongoing experiment
  3. Reinstall PsychoPy to the most recent release (the error persisted)
  4. Ensure that ioHub package, psychopy-eyetracker-tobii pacakage and Tobii Eyetracker Support plugin are installed
  5. Ensure that relevant libraries are imported in the python script
import psychopy.iohub as io 
from psychopy import sound, gui, visual, core, data, event, logging, clock, colors, layout, iohub, hardware

What specifically went wrong when you tried that?:
The same error persists: