Both CalAmp (NASDAQ:CAMP) and Sierra Wireless (NASDAQ:SWIR) are making big plays on the machine-to-machine (M2M) communication segment and the broader Internet of Things (IoT) market. IDC estimates that by 2020, companies will spend $1.29 trillion annually on the IoT, but even with all of this potential, it's difficult to decipher which company is the best long-term bet in the space.

So let's a closer look at what CalAmp and Sierra Wireless do, and see if either one has any distinct advantages that may make it a better bet on the Internet of Things market. 

Image of stock chart dip.

Image source: Getty Images.

What CalAmp does

CalAmp sells M2M hardware and software to companies so they can track their equipment and analyze the data collected by it. One of the company's key customers is Caterpillar, which provided about $30 million in revenue in fiscal 2017 (which ended Feb. 28); CalAmp expects its revenue from the industrial equipment maker to increase by 10% to 20% in its fiscal 2018. 

CalAmp also purchased LoJack last year and is in the process of expanding the service into a bigger part of its overall software-as-a-service (SaaS) business. The company expects all of its SaaS products to become a $100 million annual recurring revenue business over the next few years. 

The company earned $86.1 in revenue in its fiscal fourth quarter, an increase of 22% year over year, and LoJack contributed $27.8 million.  

CalAmp's recent push into connected-vehicle technologies through LoJack has not only added revenue but also improved the company's gross margins, which hit 41.6% in the fourth quarter, up from 38.9% in the year-ago quarter.

What Sierra Wireless does

Like CalAmp, Sierra Wireless is all about connecting things to the Internet. The company's devices and cloud-based software are used in everything from electronic devices to industrial equipment to personal vehicles.   

Sierra has a leadership position in the M2M market, earning about 33% of all revenue in the embedded module market globally right now. The company says its devices are used to connect 5 billion things to the Internet and estimates that number will triple in the next four years.

The company reported revenue of $161.8 million in the first quarter, up 13% year over year. And Sierra increased its gross margins from 46.8% in Q1 2016 to 55.7% in Q1 2017. 

Which is the better investment today?

CalAmp expects revenue in the range of $84 million to $90 million in its fiscal Q1, and earnings per share in the range of $0.24 to $0.32. That would represent a 4.5% and 6.6% year-over-year drop, respectively, at the midpoint of these estimates.

That's not great for CalAmp, but investors should know that the company expects its overall business to strengthen through fiscal 2018 as recurring revenue and mobile resource management (MRM) revenues increase. 

CalAmp trades at just 14 times estimated forward earnings right now, which makes its stock well-priced given the level of upside in the growing IoT market. 

As for Sierra, the company is trading at about 25 times its forward earnings, making it a little more expensive by comparison. But Sierra is already a dominant player in the M2M space, and things are only getting better. It has shown that it knows how to expand its cloud services, and expects its cloud and connectivity total addressable market to expand from $3 billion in 2015 to $30 billion by 2021. This shift has already helped push up Sierra's cloud gross margins (from 39.3% in Q4 to 43.8% in Q1), and investors should expect Sierra to continue moving slowly but steadily toward more recurring cloud revenue. 

Because of Sierra's leading role in M2M, as well as its track record in the shift toward cloud revenue, I think it has a slight advantage over CalAmp for the time being.

Chris Neiger has no position in any stocks mentioned. The Motley Fool owns shares of and recommends Sierra Wireless. The Motley Fool recommends CalAmp. The Motley Fool has a disclosure policy.