This article proposes a general purpose IoT framework usually applicable to all Edge-to-Cloud applications and provides an evaluation study on a use-case involving automotive V2X architecture, tested and verified on a toy smart-car in an emulated smart-car environment. The architecture in study is finely tuned to mimic actual scenarios and therefore the sensors available on the toy car encompasses almost all the sensors that assist a regular ADAS in smart cars of today. The cloud connectivity is maintained through the CoAP protocol which is a standard IoT connectivity protocol. Finally, the security solution proposed is that of a smart Intrusion Detection System (IDS) that is built using Machine Learning (ML) technique and is deployed on the edge. The edge IDS is capable of performing anomaly detection and reporting both detection results as well as sensor collected big data to the cloud. On the cloud side the server stores and maintains the collected data for further retraining of ML models for edge anomaly detection which is differentiated into two categories viz. sensor anomaly detection model and network anomaly detection model. To demonstrate Software update Over The Air (SW-OTA) the cloud in the evaluation setup implements a ML model upgrade capability from the cloud to the connected edge. This implementation and evaluation provides a Proof-of-Concept of the choice of ML as IDS candidate and the framework in general to be applicable to various other IoT scenarios such as Healthcare, Smart-home, Smart-city, Harbour and Industrial environments, and so on, and paves way for future optimization studies.