I'm using the command:
However, is not able to detect whether HDMI is connected or not.
Is there other way to detect HDMI status?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
tvservice -M is used to monitor for changes to the HDMI status, ie. plugging or unplugging the HDMI cable. tvservice -s will tell you the current status including whether the cable is already plugged in. It will return a hex value, the least significant bit of which tells you the cable is plugged in (value 2) or cable is unplugged (value 1).